home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue63 / Debug / 14513 / bordebug.h < prev   
Encoding:
C/C++ Source or Header  |  2000-02-24  |  121.2 KB  |  4,283 lines

  1. #ifndef BORDEBUG_H
  2. #define BORDEBUG_H
  3.  
  4. #ifdef  __cplusplus
  5. extern  "C"
  6. {
  7. #endif
  8.  
  9.  
  10. //---------------------------------------------------------------------
  11.  
  12. /*
  13.     General information
  14.  
  15.     This set of API's facilitates the reading of debug information
  16.     in *.TDS, *.EXE, and *.DLL files, as produced by the Borland
  17.     32 bit compilers.
  18.  
  19. */
  20.  
  21. //---------------------------------------------------------------------
  22.  
  23.  
  24. /*
  25.  
  26.     Some general explanations
  27.  
  28.  
  29.     When the linker emits address information about  a symbol,
  30.     it is done in a segment: offset format.  The segment is a
  31.     logical segment index assigned by the linker and the offset
  32.     is the  offset from the beginning of the  logical segment.
  33.     The physical address is assigned by the operating system
  34.     when the program is loaded.
  35.  
  36.  
  37.  
  38.     You can go from segment:offset address in the debug info
  39.     to actual physical address during debugging in the
  40.     following way:
  41.  
  42.     - find the base address of the loaded executable
  43.     - find the segment and offset of the piece of debug
  44.       info you are interested in.  This can be a procedure,
  45.       thunk, data, etc.
  46.     - crack the pe-header, and find out the base offset
  47.       of the segment you are interested in
  48.     - Now add the base address of the executable, the
  49.       base offset of the segment, and the offset, and
  50.       you will have the physical address where the item
  51.       you are interested in is loaded at runtime.
  52.  
  53.  
  54.  
  55.  
  56.     In the following API's, if an argument is a pointer,
  57.     the caller is responsible for making sure that pointer
  58.     is pointing to a valid memory address.
  59.     These API's make no effort to check for valid pointers.
  60.  
  61.  
  62.     When you get a type index, you can use BorDebugTypeFromIndex, and
  63.     BorDebugTYPEXXXX API's to receive more information about the type.
  64.     In certain cases it is useful to call BorDebugTypeIndexToString
  65.     to get a string representing the name of the type.
  66.  
  67.     When you get a name index, you can use BorDebugNameIndexToName
  68.     or BorDebugNameIndexToUnMangledName to get the actual name as
  69.     a string.
  70.  
  71.     When you get a reg index, you can use BorDebugRegIndexToName to
  72.     get the actual name of the register.
  73.  
  74.     When you get a browser offset, you can use the browser
  75.     info API's to get more information.
  76.  
  77.  
  78. */
  79.  
  80.  
  81. //---------------------------------------------------------------------
  82.  
  83.  
  84. /*
  85.  
  86.     How to proceed reading the debug information:
  87.  
  88.     Step 1:
  89.     Register the file. This should be a .tds, .exe, or .dll file
  90.     that contains debug info. If the file registration fails, you
  91.     might have a file with no debug info.
  92.  
  93.         BorDebugRegisterFile
  94.         BorDebugUnregisterFile
  95.  
  96.  
  97.     Step 2:
  98.     Get the details about the subsections for each subsection.
  99.     Then proceed depending on the subsection you are interested in.
  100.  
  101.         BorDebugSubSectionDirOffset
  102.         BorDebugSubSectionCount
  103.         BorDebugSubSection
  104.  
  105.  
  106.     Step 3:
  107.     Use the sstModule API's to get details of sstModule subsections. You
  108.     find details here about source names, and segment ranges.
  109.  
  110.         BorDebugModule
  111.         BorDebugModuleSegment
  112.  
  113.  
  114.     Step 4:
  115.     Go through the sstAlign symbols, which are the local block symbols.
  116.     For each symbol you get a symbol kind, offset, and length, and you
  117.     can use the symbol kind to determine the correct BorDebugSymbolXXXX
  118.     API to use.
  119.  
  120.         BorDebugStartSymbols
  121.         BorDebugNextSymbol
  122.         BorDebugSymbolXXXX functions
  123.  
  124.     Step 5:
  125.     Use the sstSrcModule API's to get all the details of sstSrcModule
  126.     subSections.  Here you will find the source names, the address
  127.     ranges of the code, and the line number information
  128.  
  129.         BorDebugSrcModule
  130.         BorDebugSrcModuleRanges
  131.         BorDebugSrcModuleSources
  132.         BorDebugSrcModuleSourceRanges
  133.         BorDebugSrcModuleLineNumbers
  134.  
  135.     Step 6:
  136.     Get the details of the sstGlobalSym and/or sstGlobalPub subSections.
  137.     After that you can go through the symbols, and for each symbol you
  138.     get a symbol kind, offset, and length, and you can use the symbol
  139.     kind to determine the correct BorDebugSymbolXXXX API to use.
  140.  
  141.         BorDebugGlobalSym
  142.         BorDebugSymbolXXXX functions
  143.  
  144.     Step 7:
  145.     To find out about types, get the details of the sstGlobalTypes section.
  146.     You can access each type by its 0x1000-based index number.
  147.  
  148.         BorDebugGlobalTypes
  149.         BorDebugTypeFromIndex
  150.         BorDebugTypeFromOffset
  151.         BorDebugTypeXXXX functions
  152.         BorDebugTypeIndexToString
  153.  
  154.     Step 8:
  155.     Find out how many names there are in the sstNames section.
  156.     You can go from a 1-based name index to the actual name by
  157.     using the name index converting functions.
  158.  
  159.         BorDebugNamesTotalNames
  160.         BorDebugNameIndexToUnmangledName
  161.         BorDebugNameIndexToName
  162.         BorDebugRegIndexToName
  163.  
  164. */
  165.  
  166.  
  167. //---------------------------------------------------------------------
  168.  
  169.  
  170. /*
  171.  
  172.     The different kind of subSection types these API's recognize
  173.  
  174. */
  175.  
  176. enum
  177. {
  178.     BORDEBUG_SSTMODULE      = 0x00000120,
  179.     BORDEBUG_SSTALIGNSYM    = 0x00000125,
  180.     BORDEBUG_SSTSRCMODULE   = 0x00000127,
  181.     BORDEBUG_SSTGLOBALSYM   = 0x00000129,
  182.     BORDEBUG_SSTGLOBALPUB   = 0x0000012A,   // Treated as sstGlobalSym
  183.     BORDEBUG_SSTGLOBALTYPES = 0x0000012B,
  184.     BORDEBUG_SSTNAMES       = 0x00000130,
  185.     BORDEBUG_SSTBROWSE      = 0x00000131,
  186.  
  187.     BORDEBUG_SSTINVALID     = 0xFFFFFFFF,
  188. };
  189.  
  190.  
  191. //---------------------------------------------------------------------
  192.  
  193.  
  194. /*
  195.  
  196.     The different kinds of symbols
  197.  
  198. */
  199.  
  200. enum
  201. {
  202.     BORDEBUG_S_COMPILE      = 0x00000001,
  203.     BORDEBUG_S_REGISTER     = 0x00000002,
  204.     BORDEBUG_S_CONST        = 0x00000003,
  205.     BORDEBUG_S_UDT          = 0x00000004,
  206.     BORDEBUG_S_SSEARCH      = 0x00000005,
  207.     BORDEBUG_S_END          = 0x00000006,
  208.     BORDEBUG_S_SKIP         = 0x00000007,
  209.     BORDEBUG_S_CVRESERVE    = 0x00000008,
  210.     BORDEBUG_S_OBJNAME      = 0x00000009,
  211.  
  212.     BORDEBUG_S_GPROCREF     = 0x00000020,
  213.     BORDEBUG_S_GDATAREF     = 0x00000021,
  214.     BORDEBUG_S_EDATA        = 0x00000022,
  215.     BORDEBUG_S_EPROC        = 0x00000023,
  216.     BORDEBUG_S_USES         = 0x00000024,
  217.     BORDEBUG_S_NAMESPACE    = 0x00000025,
  218.     BORDEBUG_S_USING        = 0x00000026,
  219.     BORDEBUG_S_PCONSTANT    = 0x00000027,
  220.  
  221.     BORDEBUG_S_BPREL32      = 0x00000200,
  222.     BORDEBUG_S_LDATA32      = 0x00000201,
  223.     BORDEBUG_S_GDATA32      = 0x00000202,
  224.     BORDEBUG_S_PUB32        = 0x00000203,
  225.     BORDEBUG_S_LPROC32      = 0x00000204,
  226.     BORDEBUG_S_GPROC32      = 0x00000205,
  227.     BORDEBUG_S_THUNK32      = 0x00000206,
  228.     BORDEBUG_S_BLOCK32      = 0x00000207,
  229.     BORDEBUG_S_WITH32       = 0x00000208,
  230.     BORDEBUG_S_LABEL32      = 0x00000209,
  231.     BORDEBUG_S_CEXMODEL32   = 0x0000020A,
  232.     BORDEBUG_S_VFTPATH32    = 0x0000020B,
  233.     BORDEBUG_S_ENTRY32      = 0x00000210,
  234.     BORDEBUG_S_OPTVAR32     = 0x00000211,
  235.     BORDEBUG_S_PROCRET32    = 0x00000212,
  236.     BORDEBUG_S_SAVREGS32    = 0x00000213,
  237.  
  238.     BORDEBUG_S_SLINK32      = 0x00000230,
  239.  
  240.     BORDEBUG_S_INVALID      = 0xFFFFFFFF,
  241. };
  242.  
  243.  
  244. //---------------------------------------------------------------------
  245.  
  246.  
  247. /*
  248.  
  249.     The different kind of types
  250.  
  251. */
  252.  
  253.  
  254. enum    BORDEBUG_leaf000s
  255. {
  256.     BORDEBUG_LF_STARTYP     = 0x00000000,
  257.     BORDEBUG_LF_MODIFIER    = 0x00000001,
  258.     BORDEBUG_LF_POINTER     = 0x00000002,
  259.     BORDEBUG_LF_ARRAY       = 0x00000003,
  260.     BORDEBUG_LF_CLASS       = 0x00000004,
  261.     BORDEBUG_LF_STRUCT      = 0x00000005,
  262.     BORDEBUG_LF_UNION       = 0x00000006,
  263.     BORDEBUG_LF_ENUM        = 0x00000007,
  264.     BORDEBUG_LF_PROCEDURE   = 0x00000008,
  265.     BORDEBUG_LF_MFUNCTION   = 0x00000009,
  266.     BORDEBUG_LF_VTSHAPE     = 0x0000000A,
  267.     BORDEBUG_LF_COBOL0      = 0x0000000B,
  268.     BORDEBUG_LF_COBOL1      = 0x0000000C,
  269.     BORDEBUG_LF_BARRAY      = 0x0000000D,
  270.     BORDEBUG_LF_LABEL       = 0x0000000E,
  271.     BORDEBUG_LF_NULL        = 0x0000000F,
  272.     BORDEBUG_LF_NOTTRANS    = 0x00000010,
  273.     BORDEBUG_LF_DIMARRAY    = 0x00000011,
  274.     BORDEBUG_LF_VFTPATH     = 0x00000012,
  275.     BORDEBUG_LF_SET         = 0x00000030,
  276.     BORDEBUG_LF_SUBRANGE    = 0x00000031,
  277.     BORDEBUG_LF_PARRAY      = 0x00000032,
  278.     BORDEBUG_LF_PSTRING     = 0x00000033,
  279.     BORDEBUG_LF_CLOSURE     = 0x00000034,
  280.     BORDEBUG_LF_PROPERTY    = 0x00000035,
  281.     BORDEBUG_LF_LSTRING     = 0x00000036,
  282.     BORDEBUG_LF_VARIANT     = 0x00000037,
  283.     BORDEBUG_LF_CLASSREF    = 0x00000038,
  284.     BORDEBUG_LF_WSTRING     = 0x00000039,
  285.     BORDEBUG_LF_UNKNOWN     = 0x000000EF,
  286.  
  287.     BORDEBUG_LF_INVALID_0   = 0xFFFFFFF0,
  288. };
  289.  
  290. enum    BORDEBUG_leaf200s
  291. {
  292.     BORDEBUG_LF_SKIP        = 0x00000200,
  293.     BORDEBUG_LF_ARGLIST     = 0x00000201,
  294.     BORDEBUG_LF_DEFARG      = 0x00000202,
  295.     BORDEBUG_LF_LIST        = 0x00000203,
  296.     BORDEBUG_LF_FIELDLIST   = 0x00000204,
  297.     BORDEBUG_LF_DERIVED     = 0x00000205,
  298.     BORDEBUG_LF_BITFIELD    = 0x00000206,
  299.     BORDEBUG_LF_METHODLIST  = 0x00000207,
  300.     BORDEBUG_LF_DIMCONU     = 0x00000208,
  301.     BORDEBUG_LF_DIMCONLU    = 0x00000209,
  302.     BORDEBUG_LF_DIMVARU     = 0x0000020A,
  303.     BORDEBUG_LF_DIMVARLU    = 0x0000020B,
  304.     BORDEBUG_LF_REFSYM      = 0x0000020C,
  305.  
  306.     BORDEBUG_LF_INVALID_2   = 0xFFFFFFF2,
  307. };
  308.  
  309. enum    BORDEBUG_leaf400s
  310. {
  311.     BORDEBUG_LF_BCLASS      = 0x00000400,
  312.     BORDEBUG_LF_VBCLASS     = 0x00000401,
  313.     BORDEBUG_LF_IVBCLASS    = 0x00000402,
  314.     BORDEBUG_LF_ENUMERATE   = 0x00000403,
  315.     BORDEBUG_LF_FRIENDFCN   = 0x00000404,
  316.     BORDEBUG_LF_INDEX       = 0x00000405,
  317.     BORDEBUG_LF_MEMBER      = 0x00000406,
  318.     BORDEBUG_LF_STMEMBER    = 0x00000407,
  319.     BORDEBUG_LF_METHOD      = 0x00000408,
  320.     BORDEBUG_LF_NESTTYPE    = 0x00000409,
  321.     BORDEBUG_LF_VFUNCTAB    = 0x0000040A,
  322.     BORDEBUG_LF_FRIENDCLS   = 0x0000040B,
  323.  
  324.     BORDEBUG_LF_INVALID_4   = 0xFFFFFFF4,
  325. };
  326.  
  327. enum    BORDEBUG_leaf800s
  328. {
  329.     BORDEBUG_LF_CHAR        = 0x00008000,
  330.     BORDEBUG_LF_SHORT       = 0x00008001,
  331.     BORDEBUG_LF_USHORT      = 0x00008002,
  332.     BORDEBUG_LF_LONG        = 0x00008003,
  333.     BORDEBUG_LF_ULONG       = 0x00008004,
  334.     BORDEBUG_LF_REAL32      = 0x00008005,
  335.     BORDEBUG_LF_REAL64      = 0x00008006,
  336.     BORDEBUG_LF_REAL80      = 0x00008007,
  337.     BORDEBUG_LF_REAL128     = 0x00008008,
  338.     BORDEBUG_LF_QUADWORD    = 0x00008009,
  339.     BORDEBUG_LF_UQUADWORD   = 0x0000800A,
  340.     BORDEBUG_LF_REAL48      = 0x0000800B,
  341.  
  342.     BORDEBUG_LF_INVALID_8   = 0xFFFFFFF8,
  343. };
  344.  
  345. enum    BORDEBUG_leaf900s
  346. {
  347.     BORDEBUG_LF_RAWBITS     = 0x00009000,
  348.     BORDEBUG_LF_INVALID_9   = 0xFFFFFFF9,
  349. };
  350.  
  351.  
  352. //---------------------------------------------------------------------
  353.  
  354.  
  355. /*
  356.  
  357.     BorDebugRegisterFile
  358.  
  359.  
  360.     Register a file with debug info
  361.  
  362.  
  363.     This should be a *.DLL, *.EXE, or *.TDS file.
  364.  
  365.  
  366.     This function simply tries to open the file using "fileName".
  367.     No attempts are made to look in the system PATH, or any other
  368.     predefined PATH's.  If the file is not in the current directory,
  369.     you have to supply a fully qualified file name.
  370.  
  371.  
  372.     You should also make sure the filename has the proper extension,
  373.     since that is how this routine figures out what kind of file
  374.     you are trying to open.
  375.  
  376.  
  377.     The sstNames subsection has no index table, it is basically a
  378.     series of zero terminated names preceded by a length byte.
  379.  
  380.     To allow some flexibility here, there are 3 possibilities:
  381.  
  382.     - set skipNames to non-zero.  This means the sstNames section
  383.       is not scanned, and no name index table is build, and no
  384.       names are cached at all.  This also means that you can't
  385.       go from a name index to a string representation.  You will
  386.       always get a blank string back from the nameIndex conversion
  387.       routines. This option saves space and time, at the expense
  388.       of no names.
  389.  
  390.     - set skipNames to zero, and set cacheNames to zero.  This
  391.       means that the sstNames section is scanned and an index
  392.       table is build. The sstNames section is not cached though
  393.       so each lookup of a name will cause a SEEK and a READ
  394.       from the file, which is slow.  This option costs some
  395.       time to build the index table, and takes up space for
  396.       the index table, and name accesses are slow.  It does
  397.       save space because the sstNames section is not cached.
  398.  
  399.     - set skipNames to zero, and set cacheNames to non-zero.
  400.       The name index table is build and the whole sstNames
  401.       section stays also in memory.  Name accesses are very
  402.       fast, but this is at the expense of the memory the
  403.       sstNames takes up.
  404.  
  405.  
  406.     If you want you can cache your own names.  You can get the
  407.     starting offset and size of the sstNames section from
  408.     BorDebugSubSection.  The first 4 bytes hold the total
  409.     number of names, and the rest of the sstNames section is
  410.     composed of zero terminated names preceded by a length
  411.     byte.  Based on this you can set up your own name cache.
  412.     Remember that name indices are 1-based.
  413.  
  414.  
  415.     fileName:   the name of the file with debug info
  416.     skipNames:  if non-zero, don't do anything with the sstNames
  417.     cacheNames: if non-zero, cache complete sstNames section
  418.     failure:    will be set on failure
  419.  
  420.  
  421.     Returns a "registerCookie" which can be used in all the
  422.     API's described below.  On success, the return value will
  423.     be non-zero. On failure, the return value will be zero,
  424.     and the failure variable will be set to an error code:
  425.  
  426.     0:  everything is fine and dandy
  427.     1:  extension not recognized
  428.     2:  cannot open the file
  429.     3:  no debug info in the file
  430.     4:  failures while reading from the file
  431.     5:  out of memory
  432.  
  433. */
  434.  
  435. typedef void * BorDebugCookie;
  436.  
  437.  
  438. BorDebugCookie  BorDebugRegisterFile(const char   * fileName,
  439.                                      unsigned int   skipNames,
  440.                                      unsigned int   cacheNames,
  441.                                      unsigned int * failure);
  442.  
  443.  
  444. /*
  445.  
  446.     BorDebugUnregisterFile
  447.  
  448.  
  449.     Unregister a file that was previously registered.
  450.     This will free up any memory used.
  451.  
  452. */
  453.  
  454.  
  455. void    BorDebugUnregisterFile(BorDebugCookie registerCookie);
  456.  
  457.  
  458.  
  459.  
  460. //---------------------------------------------------------------------
  461.  
  462. /*
  463.  
  464.     General subsection API's:
  465.  
  466. */
  467.  
  468.  
  469. /*
  470.  
  471.     BorDebugSubSectionDirOffset
  472.  
  473.  
  474.     File offset in bytes of the SubSection Dir
  475.  
  476.     return: starting offset of the subSection dir
  477.  
  478. */
  479.  
  480. unsigned int    BorDebugSubSectionDirOffset(BorDebugCookie registerCookie);
  481.  
  482.  
  483.  
  484. /*
  485.  
  486.     BorDebugSubSectionCount
  487.  
  488.  
  489.     How many subsections are there
  490.  
  491.     return:  number of subsections
  492.  
  493. */
  494.  
  495. unsigned int    BorDebugSubSectionCount(BorDebugCookie registerCookie);
  496.  
  497.  
  498.  
  499. /*
  500.  
  501.     BorDebugSubSection
  502.  
  503.  
  504.     Details of a subsection
  505.  
  506.     subSectionNo:   zero-based subsection number
  507.     subSectionType: type of subsection as in BORDEBUG_SSTXXXX
  508.     module:         the module the subsection belongs to
  509.     offset:         file offset in bytes of subsection
  510.     size:           size of subsection in bytes
  511.  
  512. */
  513.  
  514. void    BorDebugSubSection(BorDebugCookie registerCookie,
  515.                            unsigned int   subSectionNo,
  516.                            unsigned int * subSectionType,
  517.                            unsigned int * module,
  518.                            unsigned int * offset,
  519.                            unsigned int * size);
  520.  
  521.  
  522.  
  523. //---------------------------------------------------------------------
  524.  
  525. /*
  526.  
  527.     sstModule API's:
  528.  
  529. */
  530.  
  531. /*
  532.  
  533.     BorDebugModule
  534.  
  535.  
  536.     Details of a sstModule subsection
  537.  
  538.     offset:         file offset of subsection as received in BorDebugSubSection
  539.                     assumes this subsection is of sstModule type
  540.     overlay:        overlay number
  541.     libIndex:       index into sstLibrary, which we don't use
  542.     style:          debugging style
  543.     name:           name index
  544.     timeStamp:      time stamp of the module
  545.     segmentCount:   number of segments
  546.  
  547. */
  548.  
  549. void    BorDebugModule(BorDebugCookie registerCookie,
  550.                        unsigned int   offset,
  551.                        unsigned int * overlay,
  552.                        unsigned int * libIndex,
  553.                        unsigned int * style,
  554.                        unsigned int * name,
  555.                        unsigned int * timeStamp,
  556.                        unsigned int * segmentCount);
  557.  
  558.  
  559.  
  560.  
  561. /*
  562.  
  563.     BorDebugModuleSegment
  564.  
  565.  
  566.     Details of a module segment
  567.  
  568.     moduleOffset:   file offset of subsection as received in BorDebugSubSection
  569.                     assumes this subsection is of sstModule type
  570.     segmentNo:      zero-based segment number
  571.     segment:        linker segment
  572.     offset:         File offset of segment in bytes
  573.     size:           size of the segment in bytes
  574.     flags:          flags of the segment
  575.                     0 = data segment
  576.                     1 = code segment
  577.  
  578. */
  579.  
  580. void    BorDebugModuleSegment(BorDebugCookie registerCookie,
  581.                               unsigned int   moduleOffset,
  582.                               unsigned int   segmentNo,
  583.                               unsigned int * segment,
  584.                               unsigned int * offset,
  585.                               unsigned int * size,
  586.                               unsigned int * flags);
  587.  
  588.  
  589.  
  590. //---------------------------------------------------------------------
  591.  
  592. /*
  593.  
  594.     General Symbol subsection API's.
  595.  
  596.     Used for sstAlignSyms, sstGlobalSyms, and sstGlobalPubs
  597.  
  598.     The symbols in these Symbol sections are only accessible in
  599.     serial mode.  To go from one symbol to the next requires reading
  600.     the length of a symbol and forwarding the file pointer to beyond
  601.     that symbol.
  602.  
  603.     The API's supplied here are the most basic way to access serial
  604.     data.  You can build your own routines to get the total count
  605.     of the symbols, and to access symbols by index.
  606.  
  607. */
  608.  
  609.  
  610. /*
  611.  
  612.     BorDebugStartSymbols
  613.  
  614.  
  615.     Start iterating through the Symbols in the subsection
  616.  
  617.     subSectionType: type of subsection as received in BorDebugSubSection
  618.                     assumes this subsection is sstAlign, sstGlobalSym,
  619.                     or sstGlobalPub.
  620.     offset:         file offset of subsection as received in BorDebugSubSection
  621.                     assumes this subsection is sstAlign, sstGlobalSym,
  622.                     or sstGlobalPub
  623.     size:           size of subsection as received in BorDebugSubSection
  624.  
  625. */
  626.  
  627. void    BorDebugStartSymbols(BorDebugCookie registerCookie,
  628.                              unsigned int   subSectionType,
  629.                              unsigned int   offset,
  630.                              unsigned int   size);
  631.  
  632. /*
  633.  
  634.     BorDebugNextSymbol
  635.  
  636.  
  637.     Next symbol in the Symbol subsection, 0, 0, 0 if at end
  638.  
  639.     kind:           what kind of symbol is it
  640.     symOffset:      starting offset of the symbol,
  641.                     which can be used in the symbol API's below
  642.     symLen:         length of the symbol in bytes
  643.  
  644. */
  645.  
  646. void    BorDebugNextSymbol(BorDebugCookie registerCookie,
  647.                            unsigned int * kind,
  648.                            unsigned int * symOffset,
  649.                            unsigned int * symLen);
  650.  
  651.  
  652. //---------------------------------------------------------------------
  653.  
  654. /*
  655.  
  656.     Browser API's
  657.  
  658. */
  659.  
  660. /*
  661.  
  662.     BorDebugDumpBrowserInfo
  663.  
  664.  
  665.     To be determined
  666.  
  667. */
  668.  
  669. void    BorDebugDumpBrowserInfo(BorDebugCookie registerCookie,
  670.                                 unsigned int   browserOffset);
  671.  
  672. //---------------------------------------------------------------------
  673.  
  674. /*
  675.  
  676.     symbol API's for sstAlignSym, sstGlobalSym, and sstGlobalPub
  677.  
  678. */
  679.  
  680.  
  681. /*
  682.  
  683.     Details of BORDEBUG_S_COMPILE = 0x00000001
  684.  
  685.  
  686.     BorDebugSymbolCOMPILE
  687.  
  688.  
  689.     Compile flags
  690.  
  691.     This symbol communicates to Code View compile time information on a
  692.     per module basis, such as the language and version number of the
  693.     compiler, the ambient model for code and data, and the target
  694.     processor.
  695.  
  696.     symOffset: file offset of the symbol in bytes
  697.     machine:
  698.             0x00    Intel 8080
  699.             0x01    Intel 8086
  700.             0x02    Intel 80286
  701.             0x03    Intel 80386
  702.             0x04    Intel 80486
  703.             0x05    Intel 80586
  704.             0x06    Intel 80686
  705.     language:
  706.             0       C
  707.             1       C++
  708.             2       FORTRAN
  709.             3       Tasm
  710.             4       Pascal
  711.             5       Basic
  712.             6       COBOL
  713.             7-255   Reserved
  714.  
  715.     flags:
  716.             PCodePresent    :0
  717.             FloatPrecision  :1-2
  718.                     0       fast floating point
  719.                     1       ANSI compatible slow floating point
  720.             FloatPackage    :3-4
  721.                     0       Hardware processor (80x87)
  722.                     1       Emulator
  723.                     2       Altmath
  724.                     3       Reserved
  725.             AmbientData     :5-7
  726.                     0       Near
  727.                     1       Far
  728.                     2       Huge
  729.                     3-7     Reserved
  730.             AmbientCode     :8-10
  731.                     0       Near
  732.                     1       Far
  733.                     2       Huge
  734.                     3-7     Reserved
  735.             Mode32          :11     Compiled for 32 bit addresses
  736.             chsign          :12     True is 'char' is a signed type
  737.             Reserved        :13-31
  738.     compilerName:   points to memory to receive null-terminated name
  739.     maxNameCount:   size of compilerName array. The max name length
  740.                     is 255 char's, so you need at least 256 char's
  741.  
  742. */
  743.  
  744. void    BorDebugSymbolCOMPILE(BorDebugCookie registerCookie,
  745.                               unsigned int   symOffset,
  746.                               unsigned int * machine,
  747.                               unsigned int * language,
  748.                               unsigned int * flags,
  749.                               char         * compilerName,
  750.                               unsigned int   maxNameCount);
  751.  
  752.  
  753.  
  754.  
  755. /*
  756.  
  757.     Details of BORDEBUG_S_REGISTER = 0x00000002
  758.  
  759.  
  760.     BorDebugSymbolREGISTER
  761.  
  762.  
  763.     Register variable
  764.  
  765.     symOffset:      file offset of the symbol in bytes
  766.     typeIndex:      type index of the symbol
  767.     reg:            register index
  768.     name:           name index
  769.     browserOffset:  offset of browser info
  770.  
  771. */
  772.  
  773. void    BorDebugSymbolREGISTER(BorDebugCookie registerCookie,
  774.                                unsigned int   symOffset,
  775.                                unsigned int * typeIndex,
  776.                                unsigned int * reg,
  777.                                unsigned int * name,
  778.                                unsigned int * browserOffset);
  779.  
  780. /*
  781.  
  782.  
  783.     Details of BORDEBUG_S_CONST = 0x00000003
  784.  
  785.  
  786.     BorDebugSymbolCONST
  787.  
  788.  
  789.     Constants and enums. If enum, the type index refers to the
  790.     containing enum
  791.  
  792.     symOffset:      file offset of the symbol in bytes
  793.     typeIndex:      type index of the symbol
  794.     name:           name index
  795.     browserOffset:  offset of browser info
  796.     value:          what is the constant value
  797.  
  798. */
  799.  
  800. void    BorDebugSymbolCONST(BorDebugCookie registerCookie,
  801.                             unsigned int   symOffset,
  802.                             unsigned int * typeIndex,
  803.                             unsigned int * name,
  804.                             unsigned int * browserOffset,
  805.                             unsigned int * value);
  806.  
  807. /*
  808.  
  809.     Details of BORDEBUG_S_UDT = 0x00000004
  810.  
  811.  
  812.     BorDebugSymbolUDT
  813.  
  814.  
  815.     User defined type
  816.  
  817.     symOffset:      file offset of the symbol in bytes
  818.     typeIndex:      type index of the symbol
  819.     properties:     zero bit on means it's a tag, otherwise a typedef
  820.                     one  bit on means it's nested, otherwise not
  821.     name:           name index
  822.     browserOffset:  offset of browser info
  823.  
  824. */
  825.  
  826. void    BorDebugSymbolUDT(BorDebugCookie registerCookie,
  827.                           unsigned int   symOffset,
  828.                           unsigned int * typeIndex,
  829.                           unsigned int * properties,
  830.                           unsigned int * name,
  831.                           unsigned int * browserOffset);
  832.  
  833. /*
  834.  
  835.     Details of BORDEBUG_S_SSEARCH = 0x00000005
  836.  
  837.  
  838.     BorDebugSymbolSSEARCH
  839.  
  840.  
  841.     Start search
  842.  
  843.     symOffset:        file offset of the symbol in bytes
  844.     firstProcSegment: segment of first proc. symbol
  845.     firstProcOffset:  offset from symOffset of first proc. symbol
  846.     codeSymCount:     how many code symbols
  847.     dataSymCount:     how many data symbols
  848.     firstData:        offset from symOffset of first data symbol
  849.  
  850. */
  851.  
  852. void    BorDebugSymbolSSEARCH(BorDebugCookie registerCookie,
  853.                               unsigned int   symOffset,
  854.                               unsigned int * firstProcSegment,
  855.                               unsigned int * firstProcOffset,
  856.                               unsigned int * codeSymCount,
  857.                               unsigned int * dataSymCount,
  858.                               unsigned int * firstData);
  859.  
  860. /*
  861.  
  862.     Details of BORDEBUG_S_END = 0x00000006
  863.  
  864.     End of block, procedure, with, or thunk
  865.  
  866.     Nothing needed here
  867.  
  868. */
  869.  
  870.  
  871. /*
  872.  
  873.     Details of BORDEBUG_S_SKIP = 0x00000007
  874.  
  875.     Reserve space
  876.  
  877.     Not used
  878.  
  879. */
  880.  
  881.  
  882. /*
  883.  
  884.     Details of BORDEBUG_S_CVRESERVE = 0x00000008
  885.  
  886.     Code view internal use
  887.  
  888.     Not used
  889.  
  890. */
  891.  
  892. /*
  893.  
  894.     Details of BORDEBUG_S_OBJNAME = 0x00000009
  895.  
  896.  
  897.     BorDebugSymbolOBJNAME
  898.  
  899.  
  900.     Name of object file
  901.  
  902.     symOffset:  file offset of the symbol in bytes
  903.     signature:  optional signature (not used)
  904.     name:       name index
  905.  
  906. */
  907.  
  908. void    BorDebugSymbolOBJNAME(BorDebugCookie registerCookie,
  909.                               unsigned int   symOffset,
  910.                               unsigned int * signature,
  911.                               unsigned int * name);
  912.  
  913.  
  914. /*
  915.  
  916.     Details of BORDEBUG_S_GPROCREF = 0x00000020
  917.  
  918.  
  919.     BorDebugSymbolGPROCREF
  920.  
  921.  
  922.     Global procedure reference
  923.  
  924.     symOffset:      file offset of the symbol in bytes
  925.     refSymOffset:   file offset of symbol this one refers to
  926.     typeIndex:      type index of symbol this one refers to
  927.     name:           name index
  928.     browserOffset:  offset of browser info
  929.     codeSegment:    segment of the symbol
  930.     codeOffset:     offset of the symbol
  931.         If code segment == 0xFFFF, the symbol lives in
  932.         another DLL or EXE, and codeOffset is the
  933.         nameIndex of that DLL or EXE
  934.  
  935. */
  936.  
  937. void    BorDebugSymbolGPROCREF(BorDebugCookie registerCookie,
  938.                                unsigned int   symOffset,
  939.                                unsigned int * refSymOffset,
  940.                                unsigned int * typeIndex,
  941.                                unsigned int * name,
  942.                                unsigned int * browserOffset,
  943.                                unsigned int * codeSegment,
  944.                                unsigned int * codeOffset);
  945.  
  946.  
  947. /*
  948.  
  949.     Details of BORDEBUG_S_GDATAREF = 0x00000021
  950.  
  951.  
  952.     BorDebugSymbolGDATAREF
  953.  
  954.  
  955.     Global data reference
  956.  
  957.     symOffset:      file offset of the symbol in bytes
  958.     refSymOffset:   file offset of symbol this one refers to
  959.     typeIndex:      type index of symbol this one refers to
  960.     name:           name index
  961.     browserOffset:  offset of browser info
  962.     dataSegment:    segment of the symbol
  963.     dataOffset:     offset of the symbol
  964.         If datasegment == 0xFFFF, the symbol lives in
  965.         another DLL or EXE, and dataOffset is the
  966.         nameIndex of that DLL or EXE
  967.  
  968. */
  969.  
  970. void    BorDebugSymbolGDATAREF(BorDebugCookie registerCookie,
  971.                                unsigned int   symOffset,
  972.                                unsigned int * refSymOffset,
  973.                                unsigned int * typeIndex,
  974.                                unsigned int * name,
  975.                                unsigned int * browserOffset,
  976.                                unsigned int * dataSegment,
  977.                                unsigned int * dataOffset);
  978.  
  979. /*
  980.  
  981.     Details of BORDEBUG_S_EDATA = 0x00000022
  982.  
  983.  
  984.     BorDebugSymbolEDATA
  985.  
  986.  
  987.     External data
  988.  
  989.     symOffset:      file offset of the symbol in bytes
  990.     typeIndex:      type index of the symbol
  991.     name:           name index
  992.     externIndex:    index of the corresponding external
  993.     flags:          1 == TLS var.
  994.     browserOffset:  offset of browser info
  995.  
  996. */
  997.  
  998. void    BorDebugSymbolEDATA(BorDebugCookie registerCookie,
  999.                             unsigned int   symOffset,
  1000.                             unsigned int * typeIndex,
  1001.                             unsigned int * name,
  1002.                             unsigned int * externIndex,
  1003.                             unsigned int * flags,
  1004.                             unsigned int * browserOffset);
  1005.  
  1006. /*
  1007.  
  1008.     Details of BORDEBUG_S_EPROC = 0x00000023
  1009.  
  1010.  
  1011.     BorDebugSymbolEPROC
  1012.  
  1013.  
  1014.     External procedure
  1015.  
  1016.     symOffset:      file offset of the symbol in bytes
  1017.     typeIndex:      type index of the procedure
  1018.     name:           name index of the procedure
  1019.     externIndex:    index of the corresponding external
  1020.     flags:          not used yet
  1021.     browserOffset:  offset of browser info
  1022.  
  1023. */
  1024.  
  1025. void    BorDebugSymbolEPROC(BorDebugCookie registerCookie,
  1026.                             unsigned int   symOffset,
  1027.                             unsigned int * typeIndex,
  1028.                             unsigned int * name,
  1029.                             unsigned int * externIndex,
  1030.                             unsigned int * flags,
  1031.                             unsigned int * browserOffset);
  1032.  
  1033. /*
  1034.  
  1035.     Details of BORDEBUG_S_USES = 0x00000024
  1036.  
  1037.  
  1038.     BorDebugSymbolUSES
  1039.  
  1040.  
  1041.     Pascal uses
  1042.  
  1043.     symOffset:      file offset of the symbol in bytes
  1044.     nameCount:      max. number of names to return
  1045.     nameIndices:    allocated array for name indices
  1046.     returnvalue:    total number of uses names
  1047.  
  1048.     This API has to be called twice:
  1049.     First call with correct symOffset, set
  1050.     nameCount and nameIndices to 0, and the
  1051.     total number of uses names is returned.
  1052.     Next, make sure you allocate enough space for
  1053.     the array of name indices and call again with
  1054.     the symOffset, the number of name indices that
  1055.     can fit in the array and the pointer to the array.
  1056.     On return the array will be filled in.
  1057.  
  1058. */
  1059. unsigned int    BorDebugSymbolUSES(BorDebugCookie registerCookie,
  1060.                                    unsigned int   symOffset,
  1061.                                    unsigned int   nameCount,
  1062.                                    unsigned int * nameIndices);
  1063.  
  1064. /*
  1065.  
  1066.     Details of BORDEBUG_S_NAMESPACE = 0x00000025
  1067.  
  1068.  
  1069.     BorDebugSymbolNAMESPACE
  1070.  
  1071.  
  1072.     Namespace
  1073.  
  1074.     symOffset:      file offset of the symbol in bytes
  1075.     name:           name index
  1076.     browserOffset:  offset of browser info
  1077.     usingCount:     max. number of using names to return
  1078.     usingIndices:   allocated array for using name indices
  1079.     returnvalue:    total number of using names
  1080.  
  1081.     This API has to be called twice:
  1082.     First call with correct symOffset, and set usingCount,
  1083.     name, browserOffset, and usingIndices to zero and
  1084.     the total number of using names is returned.
  1085.     Next, make sure you allocate enough space for the array
  1086.     of using name indices, set usingCount to the maximum
  1087.     number of indices you want, and point name and browserOffset
  1088.     to valid memory.  On return the array and other information
  1089.     will be filled in.
  1090.  
  1091. */
  1092.  
  1093. unsigned int    BorDebugSymbolNAMESPACE(BorDebugCookie registerCookie,
  1094.                                         unsigned int   symOffset,
  1095.                                         unsigned int   usingCount,
  1096.                                         unsigned int * name,
  1097.                                         unsigned int * browserOffset,
  1098.                                         unsigned int * usingIndices);
  1099.  
  1100. /*
  1101.  
  1102.     Details of BORDEBUG_S_USING = 0x00000026
  1103.  
  1104.  
  1105.     BorDebugSymbolUSING
  1106.  
  1107.  
  1108.     Using namespace
  1109.  
  1110.     symOffset:      file offset of the symbol in bytes
  1111.     nameCount:      max. number of names to return
  1112.     nameIndices:    allocated array for name indices
  1113.     returnvalue:    total number of using names
  1114.  
  1115.     This API has to be called twice:
  1116.     First call with correct symOffset, set
  1117.     nameCount and nameIndices to 0, and the
  1118.     total number of using names is returned.
  1119.     Next, make sure you allocate enough space for
  1120.     the array of name indices and call again with
  1121.     the symOffset, the number of name indices that
  1122.     can fit in the array and the pointer to the array.
  1123.     On return the array will be filled in.
  1124.  
  1125. */
  1126.  
  1127. unsigned int    BorDebugSymbolUSING(BorDebugCookie registerCookie,
  1128.                                     unsigned int   symOffset,
  1129.                                     unsigned int   nameCount,
  1130.                                     unsigned int * nameIndices);
  1131.  
  1132. /*
  1133.  
  1134.     Details of BORDEBUG_S_PCONSTANT = 0x00000027
  1135.  
  1136.  
  1137.     BorDebugSymbolPCONSTANT
  1138.  
  1139.  
  1140.     Pascal constant
  1141.  
  1142.     symOffset:      file offset of the symbol in bytes
  1143.     typeIndex:      type index of the constant
  1144.     name:           name index of the constant
  1145.     properties:     0x10 == exported
  1146.     browserOffset:  offset of browser info
  1147.     valueMaxLen:    total length of value array
  1148.     value:          array to hold values
  1149.  
  1150.     Value should point to an array of char's to hold the string
  1151.     representation of the value of the constant.  Make sure that
  1152.     valueMaxLen holds the max. number of char's possible in value,
  1153.     including any string zero terminators.  A good valueMaxLen to
  1154.     start with is 256.
  1155.     Returns the total length of the const. value.  If the returned
  1156.     value is more than the valueMaxLen provided, the value was
  1157.     truncated.  In that case you have to call in again with a bigger
  1158.     buffer.
  1159.  
  1160. */
  1161.  
  1162. unsigned int    BorDebugSymbolPCONSTANT(BorDebugCookie  registerCookie,
  1163.                                         unsigned int    symOffset,
  1164.                                         unsigned int  * typeIndex,
  1165.                                         unsigned int  * name,
  1166.                                         unsigned int  * properties,
  1167.                                         unsigned int  * browserOffset,
  1168.                                         unsigned int    valueMaxLen,
  1169.                                         unsigned char * value);
  1170.  
  1171.  
  1172.  
  1173. /*
  1174.  
  1175.     Details of BORDEBUG_S_BPREL32 = 0x00000200
  1176.  
  1177.  
  1178.     BorDebugSymbolBPREL32
  1179.  
  1180.  
  1181.     BP relative stack entry
  1182.  
  1183.     symOffset:      file offset of the symbol in bytes
  1184.     offset:         how far removed from EBP
  1185.     typeIndex:      type index of the local
  1186.     name:           name index of the local
  1187.     browserOffset:  offset of browser info
  1188.  
  1189. */
  1190.  
  1191. void    BorDebugSymbolBPREL32(BorDebugCookie registerCookie,
  1192.                               unsigned int   symOffset,
  1193.                               unsigned int * offset,
  1194.                               unsigned int * typeIndex,
  1195.                               unsigned int * name,
  1196.                               unsigned int * browserOffset);
  1197.  
  1198.  
  1199.  
  1200. /*
  1201.  
  1202.     Details of BORDEBUG_S_LDATA32 = 0x00000201
  1203.  
  1204.  
  1205.     BorDebugSymbolLDATA32
  1206.  
  1207.  
  1208.     Local data
  1209.  
  1210.     symOffset:      file offset of the symbol in bytes
  1211.     offset:         offset of address of data
  1212.     segment:        segment of address of data
  1213.     flags:          0x1 == TLS data
  1214.     typeIndex:      type index of the symbol
  1215.     name:           name index of the symbol
  1216.     browserOffset:  offset of browser info
  1217.  
  1218. */
  1219.  
  1220. void    BorDebugSymbolLDATA32(BorDebugCookie registerCookie,
  1221.                               unsigned int   symOffset,
  1222.                               unsigned int * offset,
  1223.                               unsigned int * segment,
  1224.                               unsigned int * flags,
  1225.                               unsigned int * typeIndex,
  1226.                               unsigned int * name,
  1227.                               unsigned int * browserOffset);
  1228.  
  1229.  
  1230.  
  1231.  
  1232. /*
  1233.  
  1234.     Details of BORDEBUG_S_GDATA32 = 0x00000202
  1235.  
  1236.  
  1237.     BorDebugSymbolGDATA32
  1238.  
  1239.  
  1240.     Global data
  1241.  
  1242.     symOffset:      file offset of the symbol in bytes
  1243.     offset:         offset of address of data
  1244.     segment:        segment of address of data
  1245.     flags:          0x1 == TLS data
  1246.     typeIndex:      type index of the symbol
  1247.     name:           name index of the symbol
  1248.     browserOffset:  offset of browser info
  1249.  
  1250. */
  1251.  
  1252. void    BorDebugSymbolGDATA32(BorDebugCookie registerCookie,
  1253.                               unsigned int   symOffset,
  1254.                               unsigned int * offset,
  1255.                               unsigned int * segment,
  1256.                               unsigned int * flags,
  1257.                               unsigned int * typeIndex,
  1258.                               unsigned int * name,
  1259.                               unsigned int * browserOffset);
  1260.  
  1261.  
  1262.  
  1263. /*
  1264.  
  1265.     Details of BORDEBUG_S_PUB32 = 0x00000203
  1266.  
  1267.  
  1268.     BorDebugSymbolPUB32
  1269.  
  1270.  
  1271.     Public symbol
  1272.  
  1273.     symOffset:      file offset of the symbol in bytes
  1274.     offset:         offset of address of data
  1275.     segment:        segment of address of data
  1276.     flags:          0x1 == TLS data
  1277.     typeIndex:      type index of the symbol
  1278.     name:           name index of the symbol
  1279.     browserOffset:  offset of browser info
  1280.  
  1281. */
  1282.  
  1283. void    BorDebugSymbolPUB32(BorDebugCookie registerCookie,
  1284.                             unsigned int   symOffset,
  1285.                             unsigned int * offset,
  1286.                             unsigned int * segment,
  1287.                             unsigned int * flags,
  1288.                             unsigned int * typeIndex,
  1289.                             unsigned int * name,
  1290.                             unsigned int * browserOffset);
  1291.  
  1292.  
  1293.  
  1294. /*
  1295.  
  1296.     Details of BORDEBUG_S_LPROC32 = 0x00000204
  1297.  
  1298.  
  1299.     BorDebugSymbolLPROC32
  1300.  
  1301.  
  1302.     Local procedure
  1303.  
  1304.     symOffset:      file offset of the symbol in bytes
  1305.     parent:         address of parent of this procedure as
  1306.                     measured from the start of the subsection
  1307.     end:            address of the end of the debug info of
  1308.                     this procedure (and all its locals) as
  1309.                     measured from the start of the subsection
  1310.     next:           address of the debug info of the next
  1311.                     procedure as measured from the start of
  1312.                     the subsection
  1313.     codeLength:     length in bytes of the code in the procedure
  1314.     debugStart:     start of the debug info from "offset"
  1315.     debugEnd:       end of the debug info from "offset"
  1316.     offset:         starting address of the code of the procedure
  1317.     segment:        segment of address the code of the procedure
  1318.     flags:          looks like it's always zero for now
  1319.     typeIndex:      type index of the procedure
  1320.     name:           name index of the procedure
  1321.     browserOffset:  offset of browser info
  1322.  
  1323. */
  1324.  
  1325. void    BorDebugSymbolLPROC32(BorDebugCookie registerCookie,
  1326.                               unsigned int   symOffset,
  1327.                               unsigned int * parent,
  1328.                               unsigned int * end,
  1329.                               unsigned int * next,
  1330.                               unsigned int * codeLength,
  1331.                               unsigned int * debugStart,
  1332.                               unsigned int * debugEnd,
  1333.                               unsigned int * offset,
  1334.                               unsigned int * segment,
  1335.                               unsigned int * flags,
  1336.                               unsigned int * typeIndex,
  1337.                               unsigned int * name,
  1338.                               unsigned int * browserOffset);
  1339.  
  1340.  
  1341.  
  1342. /*
  1343.  
  1344.     Details of BORDEBUG_S_GPROC32 = 0x00000205
  1345.  
  1346.  
  1347.     BorDebugSymbolGPROC32
  1348.  
  1349.  
  1350.     Global procedure
  1351.  
  1352.  
  1353.     symOffset:      file offset of the symbol in bytes
  1354.     parent:         address of parent of this procedure as
  1355.                     measured from the start of the subsection
  1356.     end:            address of the end of the debug info of
  1357.                     this procedure (and all its locals) as
  1358.                     measured from the start of the subsection
  1359.     next:           address of the debug info of the next
  1360.                     procedure as measured from the start of
  1361.                     the subsection
  1362.     codeLength:     length in bytes of the code in the procedure
  1363.     debugStart:     start of the debug info from "offset"
  1364.     debugEnd:       end of the debug info from "offset"
  1365.     offset:         starting address of the code of the procedure
  1366.     segment:        segment of address of the code of the procedure
  1367.     flags:          looks like it's always zero for now
  1368.     typeIndex:      type index of the procedure
  1369.     name:           name index of the procedure
  1370.     browserOffset:  offset of browser info
  1371.     linkName:       name of the procedure in the link phase
  1372.                     should point to maxLinkName char's of memory
  1373.     maxLinkName:    max. number of char's including zero terminator
  1374.                     that can be filled in at the linkName parameter
  1375.  
  1376. */
  1377.  
  1378. unsigned int    BorDebugSymbolGPROC32(BorDebugCookie registerCookie,
  1379.                                       unsigned int   symOffset,
  1380.                                       unsigned int * parent,
  1381.                                       unsigned int * end,
  1382.                                       unsigned int * next,
  1383.                                       unsigned int * codeLength,
  1384.                                       unsigned int * debugStart,
  1385.                                       unsigned int * debugEnd,
  1386.                                       unsigned int * offset,
  1387.                                       unsigned int * segment,
  1388.                                       unsigned int * flags,
  1389.                                       unsigned int * typeIndex,
  1390.                                       unsigned int * name,
  1391.                                       unsigned int * browserOffset,
  1392.                                       char         * linkName,
  1393.                                       unsigned int   maxLinkName);
  1394.  
  1395.  
  1396.  
  1397. /*
  1398.  
  1399.     Details of BORDEBUG_S_THUNK32 = 0x00000206
  1400.  
  1401.  
  1402.     BorDebugSymbolTHUNK32
  1403.  
  1404.  
  1405.     Thunk
  1406.  
  1407.  
  1408.     symOffset:      file offset of the symbol in bytes
  1409.     parent:         address of parent of this thunk as
  1410.                     measured from the start of the subsection
  1411.     end:            address of the end of this thunk as
  1412.                     measured from the start of the subsection
  1413.     next:           address of next thunk as measured
  1414.                     from the start of the subsection
  1415.     offset:         starting address of the thunk
  1416.     segment:        segment of address of the thunk
  1417.     codeLength:     length in bytes of the code in the thunk
  1418.     ordinal:        0 == no type
  1419.                     1 == adjustor, delta = delta
  1420.                     2 == virtual call, delta == displacement
  1421.     name:           name index
  1422.     delta:          see notes under ordinal above
  1423.  
  1424. */
  1425.  
  1426. void    BorDebugSymbolTHUNK32(BorDebugCookie registerCookie,
  1427.                               unsigned int   symOffset,
  1428.                               unsigned int * parent,
  1429.                               unsigned int * end,
  1430.                               unsigned int * next,
  1431.                               unsigned int * offset,
  1432.                               unsigned int * segment,
  1433.                               unsigned int * codeLength,
  1434.                               unsigned int * ordinal,
  1435.                               unsigned int * name,
  1436.                               unsigned int * delta);
  1437.  
  1438.  
  1439.  
  1440. /*
  1441.  
  1442.     Details of BORDEBUG_S_BLOCK32 = 0x00000207
  1443.  
  1444.  
  1445.     BorDebugSymbolBLOCK32
  1446.  
  1447.  
  1448.     Block
  1449.  
  1450.     symOffset:      file offset of the symbol in bytes
  1451.     parent:         address of parent of this block as
  1452.                     measured from the start of the subsection
  1453.     end:            address of the end of this block as
  1454.                     measured from the start of the subsection
  1455.     codeLength:     length in bytes of the code of the block
  1456.     offset:         offset of the code address of the block
  1457.     segment:        segment of the code address of the block
  1458.     name:           name index
  1459.  
  1460. */
  1461.  
  1462. void    BorDebugSymbolBLOCK32(BorDebugCookie registerCookie,
  1463.                               unsigned int   symOffset,
  1464.                               unsigned int * parent,
  1465.                               unsigned int * end,
  1466.                               unsigned int * codeLength,
  1467.                               unsigned int * offset,
  1468.                               unsigned int * segment,
  1469.                               unsigned int * name);
  1470.  
  1471.  
  1472.  
  1473.  
  1474. /*
  1475.  
  1476.     Details of BORDEBUG_S_WITH32 = 0x00000208
  1477.  
  1478.  
  1479.     BorDebugSymbolWITH32
  1480.  
  1481.  
  1482.     With
  1483.  
  1484.     symOffset:      file offset of the symbol in bytes
  1485.     parent:         address of parent of with as
  1486.                     measured from the start of the subsection
  1487.     codeLength:     length in bytes of the code of the with block
  1488.     offset:         offset of address of start of the code of with
  1489.     segment:        segment of address of start of the code of with
  1490.     flags:          0 : nameIndex is true nameIndex
  1491.                     1 : nameIndex is offset in sstAlignSym (obsolete)
  1492.     typeIndex:      type index of the symbol
  1493.     name:           name index of the symbol
  1494.     varOffset:      offset within record if the with variable is
  1495.                     a field in a record
  1496.  
  1497. */
  1498.  
  1499. void    BorDebugSymbolWITH32(BorDebugCookie registerCookie,
  1500.                              unsigned int   symOffset,
  1501.                              unsigned int * parent,
  1502.                              unsigned int * codeLength,
  1503.                              unsigned int * offset,
  1504.                              unsigned int * segment,
  1505.                              unsigned int * flags,
  1506.                              unsigned int * typeIndex,
  1507.                              unsigned int * name,
  1508.                              unsigned int * varOffset);
  1509.  
  1510.  
  1511.  
  1512. /*
  1513.  
  1514.     Details of BORDEBUG_S_LABEL32 = 0x00000209
  1515.  
  1516.  
  1517.     BorDebugSymbolLABEL32
  1518.  
  1519.  
  1520.     Label
  1521.  
  1522.     symOffset:      file offset of the symbol in bytes
  1523.     offset:         offset of address of start of label
  1524.     segment:        segment of address of start of label
  1525.     nearFar:        0 : near, 4 : far
  1526.     name:           name index
  1527.  
  1528. */
  1529.  
  1530. void    BorDebugSymbolLABEL32(BorDebugCookie registerCookie,
  1531.                               unsigned int   symOffset,
  1532.                               unsigned int * offset,
  1533.                               unsigned int * segment,
  1534.                               unsigned int * nearFar,
  1535.                               unsigned int * name);
  1536.  
  1537.  
  1538.  
  1539. /*
  1540.  
  1541.     Details of BORDEBUG_S_CEXMODEL32 = 0x0000020A
  1542.  
  1543.     Change execution model
  1544.  
  1545.     Not used
  1546.  
  1547. */
  1548.  
  1549. /*
  1550.  
  1551.     Details of BORDEBUG_S_VFTPATH32 = 0x0000020B
  1552.  
  1553.     Virtual function table path
  1554.  
  1555.     Not used
  1556.  
  1557. */
  1558.  
  1559. /*
  1560.  
  1561.     Details of BORDEBUG_S_ENTRY32 = 0x00000210
  1562.  
  1563.  
  1564.     BorDebugSymbolENTRY32
  1565.  
  1566.  
  1567.     Entry point of application
  1568.  
  1569.     symOffset:  file offset of the symbol in bytes
  1570.     offset:     offset of address of function
  1571.     segment:    segment of address of function
  1572.  
  1573. */
  1574.  
  1575. void    BorDebugSymbolENTRY32(BorDebugCookie registerCookie,
  1576.                               unsigned int   symOffset,
  1577.                               unsigned int * offset,
  1578.                               unsigned int * segment);
  1579.  
  1580.  
  1581.  
  1582.  
  1583. /*
  1584.  
  1585.     Details of BORDEBUG_S_OPTVAR32 = 0x00000211
  1586.  
  1587.  
  1588.     BorDebugSymbolOPTVAR32
  1589.  
  1590.  
  1591.     Optimized variable
  1592.  
  1593.     This API has to be called twice:
  1594.     The first time call with the correct symOffset
  1595.     and leave maxEntries 0 and startEntries, lengthEntries,
  1596.     and regNameEntries NULL, and the returned value is
  1597.     the number of entries for the optimized variable.
  1598.     The second time, allocate memory for startEntries,
  1599.     lengthEntries, and regNameEntries, and set
  1600.     maxEntries to the max. number of entries
  1601.     expected.  On return the three arrays will be
  1602.     filled in.
  1603.  
  1604.     symOffset:      file offset of the symbol in bytes
  1605.     maxEntries:     max. number of entries wanted
  1606.     startEntries:   starting offsets of the entries
  1607.     lengthEntries:  length in bytes of the entries
  1608.     regNameEntries: register name indices of the entries
  1609.                     use RegIndexToName to get the names
  1610.  
  1611. */
  1612.  
  1613. unsigned int    BorDebugSymbolOPTVAR32(BorDebugCookie registerCookie,
  1614.                                        unsigned int   symOffset,
  1615.                                        unsigned int   maxEntries,
  1616.                                        unsigned int * startEntries,
  1617.                                        unsigned int * lengthEntries,
  1618.                                        unsigned int * regNameEntries);
  1619.  
  1620.  
  1621.  
  1622. /*
  1623.  
  1624.     Details of BORDEBUG_S_PROCRET32 = 0x00000212
  1625.  
  1626.  
  1627.     BorDebugSymbolPROCRET32
  1628.  
  1629.  
  1630.     Procedure return point
  1631.  
  1632.     symOffset:  file offset of the symbol in bytes
  1633.     offset:     starting address of function epilogue
  1634.     length:     length of function epilogue
  1635.  
  1636. */
  1637.  
  1638. void    BorDebugSymbolPROCRET32(BorDebugCookie registerCookie,
  1639.                                 unsigned int   symOffset,
  1640.                                 unsigned int * offset,
  1641.                                 unsigned int * length);
  1642.  
  1643.  
  1644.  
  1645.  
  1646. /*
  1647.  
  1648.     Details of BORDEBUG_S_SAVREGS32 = 0x00000213
  1649.  
  1650.  
  1651.     BorDebugSymbolSAVREGS32
  1652.  
  1653.  
  1654.     Callee saved registers
  1655.  
  1656.     symOffset:  file offset of the symbol in bytes
  1657.     mask:       Saved registers:
  1658.                 EBX == 0x0001
  1659.                 EDI == 0x0002
  1660.                 ESI == 0x0004
  1661.                 EBP == 0x0008
  1662.     offset:     EBP relative stack offset
  1663.  
  1664. */
  1665.  
  1666. void    BorDebugSymbolSAVREGS32(BorDebugCookie registerCookie,
  1667.                                 unsigned int   symOffset,
  1668.                                 unsigned int * mask,
  1669.                                 unsigned int * offset);
  1670.  
  1671.  
  1672.  
  1673. /*
  1674.  
  1675.     Details of BORDEBUG_S_SLINK32 = 0x00000230
  1676.  
  1677.  
  1678.     BorDebugSymbolSLINK32
  1679.  
  1680.  
  1681.     Pascal static link symbol. The offset in the parent stack
  1682.     frame of a variable that is accessed in a local procedure
  1683.  
  1684.     symOffset:      file offset of the symbol in bytes
  1685.     return:         the offset of the variable in the parent stack frame
  1686.  
  1687. */
  1688.  
  1689. unsigned int    BorDebugSymbolSLINK32(BorDebugCookie registerCookie,
  1690.                                       unsigned int   symOffset);
  1691.  
  1692.  
  1693.  
  1694. //---------------------------------------------------------------------
  1695.  
  1696. /*
  1697.  
  1698.     sstSrcModule API's
  1699.  
  1700. */
  1701.  
  1702.  
  1703. /*
  1704.  
  1705.     Here is some example source code about how to access the
  1706.     SrcModule API's.
  1707.  
  1708.  
  1709.  
  1710.         // Get the counts
  1711.         BorDebugSrcModule(cookie, offset, &rangeNum, &sourceNum);
  1712.  
  1713.         // Get the range details
  1714.         rangeSegs = malloc(rangeNum * sizeof(unsigned int));
  1715.         rangeStarts = malloc(rangeNum * sizeof(unsigned int));
  1716.         rangeEnds = malloc(rangeNum * sizeof(unsigned int));
  1717.  
  1718.         BorDebugSrcModuleRanges(cookie, offset, rangeSegs, rangeStarts, rangeEnds);
  1719.  
  1720.         // Print out the segments, starting offsets and ending offsets of the ranges.
  1721.  
  1722.  
  1723.         // free them all
  1724.         free(rangeSegs);
  1725.         free(rangeStarts);
  1726.         free(rangeEnds);
  1727.  
  1728.         // Get the source details
  1729.         sourceOffsets = malloc(sourceNum * sizeof(unsigned int));
  1730.         sourceNames = malloc(sourceNum * sizeof(unsigned int));
  1731.         sourceRangeCounts = malloc(sourceNum * sizeof(unsigned int));
  1732.  
  1733.         BorDebugSrcModuleSources(cookie,
  1734.                                  offset,
  1735.                                  sourceOffsets,
  1736.                                  sourceNames,
  1737.                                  sourceRangeCounts);
  1738.  
  1739.         // Print out the offsets of the source file records in the
  1740.         // file and the names of the sources
  1741.  
  1742.  
  1743.         // Free some
  1744.  
  1745.         free(sourceNames);
  1746.         free(sourceOffsets);
  1747.  
  1748.  
  1749.         // For each range in each source
  1750.  
  1751.         for (sourceIndex = 0; sourceIndex < sourceNum; sourceIndex++)
  1752.         {
  1753.             // Get the range details for each source
  1754.             rangeSegs = malloc(sourceRangeCounts[sourceIndex] * sizeof(unsigned int));
  1755.             rangeStarts = malloc(sourceRangeCounts[sourceIndex] * sizeof(unsigned int));
  1756.             rangeEnds = malloc(sourceRangeCounts[sourceIndex] * sizeof(unsigned int));
  1757.             rangeLineCounts = malloc(sourceRangeCounts[sourceIndex] * sizeof(unsigned int));
  1758.  
  1759.             BorDebugSrcModuleSourceRanges(cookie,
  1760.                                           offset,
  1761.                                           sourceIndex,
  1762.                                           rangeSegs,
  1763.                                           rangeStarts,
  1764.                                           rangdEnds,
  1765.                                           rangeLineCounts);
  1766.  
  1767.             // Do something with the range details
  1768.  
  1769.  
  1770.             // For each range, get the line number details
  1771.             for (rangeIndex = 0; rangeIndex < sourceRangeCounts[sourceIndex]; rangeIndex++)
  1772.             {
  1773.                 lineNums = malloc(rangeLineCounts[rangeIndex] * sizeof(unsigned int));
  1774.                 lineOffs = malloc(rangeLineCounts[rangeIndex] * sizeof(unsigned int));
  1775.  
  1776.                 BorDebugSrcModuleLineNumbers(cookie,
  1777.                                              offset,
  1778.                                              sourceIndex,
  1779.                                              rangeIndex,
  1780.                                              lineNums,
  1781.                                              lineOffs);
  1782.  
  1783.                 // Do something with the line number details
  1784.  
  1785.                 // Free
  1786.                 free(lineNums);
  1787.                 free(lineOffs);
  1788.             }
  1789.  
  1790.             free(rangeSegs);
  1791.             free(rangeStarts);
  1792.             free(rangeEnds);
  1793.             free(rangeLineCounts);
  1794.         }
  1795.  
  1796.         free(sourceRangeCounts);
  1797.  
  1798.  
  1799. */
  1800.  
  1801. /*
  1802.  
  1803.     BorDebugSrcModule
  1804.  
  1805.  
  1806.     Details of a sstSrcModule subsection
  1807.  
  1808.     offset:         file offset of subsection as received in BorDebugSubSection
  1809.                     assumes this subsection is of sstSrcModule type
  1810.     rangeCount:     number of code ranges
  1811.                     access them with BorDebugSrcModuleRanges
  1812.     sourceCount:    number of source files
  1813.                     access them with BorDebugSrcModuleSources
  1814.  
  1815.  
  1816. */
  1817.  
  1818. void    BorDebugSrcModule(BorDebugCookie registerCookie,
  1819.                           unsigned int   offset,
  1820.                           unsigned int * rangeCount,
  1821.                           unsigned int * sourceCount);
  1822.  
  1823.  
  1824.  
  1825. /*
  1826.  
  1827.     BorDebugSrcModuleRanges
  1828.  
  1829.  
  1830.     Details of the code ranges in the sstSrcModule
  1831.  
  1832.     The total number of code ranges is known from BorDebugSrcModule.
  1833.     When you call this API, make sure to allocate enough memory for the
  1834.     three arrays, each should be of size number of code ranges *
  1835.     sizeof(unsigned int).
  1836.  
  1837.     offset:             file offset of subsection as received in BorDebugSubSection
  1838.                         assumes this subsection is of sstSrcModule type
  1839.     segments:           points to array of segments, one for each code range
  1840.     segmentStarts:      points to array of segment starts, one for each code range
  1841.     segmentEnds:        points to array of segment ends, one for each code range
  1842.  
  1843. */
  1844.  
  1845. void    BorDebugSrcModuleRanges(BorDebugCookie registerCookie,
  1846.                                 unsigned int   offset,
  1847.                                 unsigned int * segments,
  1848.                                 unsigned int * segmentStarts,
  1849.                                 unsigned int * segmentEnds);
  1850.  
  1851.  
  1852.  
  1853.  
  1854. /*
  1855.  
  1856.     BorDebugSrcModuleSources
  1857.  
  1858.  
  1859.     Details of source files in the sstSrcModule
  1860.  
  1861.     The total number of source files is known from
  1862.     BorDebugSrcModuleSource. When you call this API, make
  1863.     sure to allocate enough memory for the three arrays, each
  1864.     should be of size number of source files * sizeof(unsigned int)
  1865.  
  1866.     offset:         file offset of subsection as received in BorDebugSubSection
  1867.                     assumes this subsection is of sstSrcModule type
  1868.     sourceOffsets:  points to array of file offsets of source file records
  1869.     names:          points to array of name indices of the sources
  1870.     rangeCounts:    points to array of number of code ranges in the sources
  1871.                     access them with BorDebugSrcModuleSourceRanges
  1872.  
  1873. */
  1874.  
  1875. void    BorDebugSrcModuleSources(BorDebugCookie registerCookie,
  1876.                                  unsigned int   offset,
  1877.                                  unsigned int * sourceOffsets,
  1878.                                  unsigned int * names,
  1879.                                  unsigned int * rangeCounts);
  1880.  
  1881.  
  1882.  
  1883.  
  1884. /*
  1885.  
  1886.     BorDebugSrcModuleSourceRanges
  1887.  
  1888.  
  1889.     Details of code ranges in a source file in sstSrcModule
  1890.  
  1891.  
  1892.     The total number of code ranges is known from
  1893.     BorDebugSrcModuleSource. When you call this API, make
  1894.     sure to allocate enough memory for the four arrays, each
  1895.     should be of size number of code ranges * sizeof(unsigned int)
  1896.  
  1897.     Source refers to a 0-based source file index.  The total number of
  1898.     source files is known from BorDebugSrcModuleSource, and this API
  1899.     allows you to iterate through those source files.
  1900.  
  1901.     offset:             file offset of subsection as received in BorDebugSubSection
  1902.                         assumes this subsection is of sstSrcModule type
  1903.     source:             0-based the source being questioned
  1904.     segments:           points to array of segments
  1905.     segmentStarts:      points to array of segment starts
  1906.     segmentEnds:        points to array of segment ends
  1907.     lineNumberCounts:   points to array of line number / address pair counts
  1908.                         access them with BorDebugSrcModuleLineNumbers
  1909.  
  1910. */
  1911.  
  1912. void    BorDebugSrcModuleSourceRanges(BorDebugCookie registerCookie,
  1913.                                       unsigned int   offset,
  1914.                                       unsigned int   source,
  1915.                                       unsigned int * segments,
  1916.                                       unsigned int * segmentStarts,
  1917.                                       unsigned int * segmentEnds,
  1918.                                       unsigned int * lineNumberCounts);
  1919.  
  1920.  
  1921. /*
  1922.  
  1923.     BorDebugSrcModuleLineNumbers
  1924.  
  1925.  
  1926.     The total number of line number / address pairs is known from
  1927.     BorDebugSrcModuleSourceRanges.
  1928.     When you call this API, make sure to allocate enough memory for the
  1929.     two arrays, each should be of size number of pairs * sizeof(unsigned int).
  1930.  
  1931.  
  1932.     Details of line number / address pairs of a range in a source
  1933.  
  1934.     offset:         file offset of subsection as received in BorDebugSubSection
  1935.                     assumes this subsection is of sstSrcModule type
  1936.     source:         the source being questioned
  1937.     range:          the range being questioned
  1938.     lineNumbers:    line number
  1939.     lineOffsets:    address of line
  1940.  
  1941. */
  1942.  
  1943. void    BorDebugSrcModuleLineNumbers(BorDebugCookie registerCookie,
  1944.                                      unsigned int   offset,
  1945.                                      unsigned int   source,
  1946.                                      unsigned int   range,
  1947.                                      unsigned int * lineNumber,
  1948.                                      unsigned int * lineOffset);
  1949.  
  1950.  
  1951. //---------------------------------------------------------------------
  1952.  
  1953. /*
  1954.  
  1955.     sstGlobalSym and sstGlobalPub API's
  1956.  
  1957. */
  1958.  
  1959. /*
  1960.  
  1961.     BorDebugGlobalSym
  1962.  
  1963.  
  1964.     Get the general details of a sstGlobalSym or a sstGlobalPub
  1965.  
  1966.     offset:             file offset of subsection as received in
  1967.                         BorDebugSubSection assumes this subsection is
  1968.                         of sstGlobalSym or sstGlobalPub type.
  1969.  
  1970.     symHashFunction:    name index of symbol hash function
  1971.     addrHashFunction:   name index of address hash function
  1972.     symTableBytes:      total bytes in the symbol table
  1973.     symHashTableBytes:  total bytes in the symbol hash table
  1974.     addrHashTableBytes: total bytes in the address hash table
  1975.     totalUDTs:          total number of user defined types
  1976.     totalOtherSyms:     total number of other symbols
  1977.     totalSymbols:       total number of symbols
  1978.     totalNameSpaces:    total number of namespaces
  1979.  
  1980. */
  1981.  
  1982.  
  1983. void    BorDebugGlobalSym(BorDebugCookie registerCookie,
  1984.                           unsigned int   offset,
  1985.                           unsigned int * symHashFunction,
  1986.                           unsigned int * addrHashFunction,
  1987.                           unsigned int * symTableBytes,
  1988.                           unsigned int * symHashTableBytes,
  1989.                           unsigned int * addrHashTableBytes,
  1990.                           unsigned int * totalUDTs,
  1991.                           unsigned int * totalOtherSyms,
  1992.                           unsigned int * totalSymbols,
  1993.                           unsigned int * totalNameSpaces);
  1994.  
  1995.  
  1996.  
  1997.  
  1998. //---------------------------------------------------------------------
  1999.  
  2000. /*
  2001.  
  2002.     sstGlobalTypes API's
  2003.  
  2004. */
  2005.  
  2006. /*
  2007.  
  2008.     BorDebugGlobalTypes
  2009.  
  2010.  
  2011.     Get the general details of the sstGlobalTypes section
  2012.  
  2013.     signature:      signature at the start
  2014.     totalTypes:     total number of types
  2015.                     You can access each 0x1000 based type index
  2016.                     with the type index API's
  2017.  
  2018. */
  2019.  
  2020. void    BorDebugGlobalTypes(BorDebugCookie registerCookie,
  2021.                             unsigned int * signature,
  2022.                             unsigned int * totalTypes);
  2023.  
  2024.  
  2025. //---------------------------------------------------------------------
  2026.  
  2027. /*
  2028.  
  2029.     Type index API's
  2030.  
  2031. */
  2032.  
  2033. /*
  2034.  
  2035.     IMPORTANT:
  2036.  
  2037.     All type indices are 0x1000 based
  2038.     None of the API's checks for type index validity.
  2039.     If you access types 0-based, you will get either
  2040.     crashes or bogus results.
  2041.  
  2042.     Types are build up from leaves (BORDEBUG_LF_XXX records)
  2043.  
  2044.     There are several types of leaves:
  2045.     - Types directly referenced in symbols (0x00000001 - 0x000000EE)
  2046.       See enum leaf000s, defined at the top of the file
  2047.     - Types referenced by other types (0x00000200 - 0x000002EE)
  2048.       See enum leaf200s, defined at the top of the file
  2049.     - Internal leaves to build more complex types (0x00000400 - 0x000004EE)
  2050.       See enum leaf400s, defined at the top of the file
  2051.  
  2052.     There are also numeric leaves (0x00008000 - 0x000080EE), but when
  2053.     you use these API's you will probably never see them.
  2054.  
  2055.     Finally there are padding leaves (0xF0 - 0xFF), although when you
  2056.     use these API's you shouldn't see any.
  2057.  
  2058.     Each type starts at a leaf (type kind).  This type kind will give
  2059.     some information, and will often refer to other types by their
  2060.     0x1000 based type index numbers.  You follow these underlying types
  2061.     by calling BorDebugTypeFromIndex with the type index, which will give
  2062.     you the offset and the kind, after which you can call the relevant
  2063.     BorDebugTypeXXXX API.
  2064.     To understand the complete type, keep following the type indices
  2065.     till there are no more references to underlying types.
  2066.  
  2067.     The BorDebugTypeXXXX API's don't check if the type starting at the
  2068.     offset you provide is indeed of the expected type.  Mysterious
  2069.     results and random crashes will happen if you don't match the
  2070.     correct BorDebugTypeXXXX with the corresponding BORDEBUG_LF_XXXX value.
  2071.  
  2072. */
  2073.  
  2074. //---------------------------------------------------------------------
  2075.  
  2076.  
  2077. /*
  2078.  
  2079.     BorDebugTypeFromIndex
  2080.  
  2081.  
  2082.     Get the general info for a type from its index
  2083.  
  2084.  
  2085.     This is the random access way of reading the types.  All you need
  2086.     is a 0x1000 based type index, and you'll find out what type it is
  2087.     and where it starts.
  2088.  
  2089.  
  2090.     BorDebugTypeFromIndex will give you the starting point of a
  2091.     certain type with index "typeIndex", which should be 0x1000
  2092.     based.  Each type points to a primary type kind.  Based on
  2093.     the type kind you get back from BorDebugTypeFromIndex, call
  2094.     the appropriate BorDebugTypeXXXX routine supplying the
  2095.     typeOffset you also got from BorDebugTypeFromIndex.
  2096.  
  2097.  
  2098.     typeIndex:  0x1000 based type index
  2099.     typeOffset: file offset in bytes of the primary type
  2100.     length:     length in bytes of the primary type
  2101.     typeKind:   BORDEBUG_LF_XXX kind of the primary type
  2102.  
  2103. */
  2104.  
  2105. void    BorDebugTypeFromIndex(BorDebugCookie registerCookie,
  2106.                               unsigned int   typeIndex,
  2107.                               unsigned int * typeOffset,
  2108.                               unsigned int * length,
  2109.                               unsigned int * typeKind);
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115. /*
  2116.  
  2117.     BorDebugTypeFromOffset
  2118.  
  2119.  
  2120.     Get the general info for a type from its offset
  2121.  
  2122.  
  2123.     In some cases a program needs to get the basic information of
  2124.     a type based on its starting offset.  This is true for instance
  2125.     for .obj and .lib files where the types are ordered sequentially
  2126.     with no type index table.
  2127.  
  2128.  
  2129.     BorDebugTypeFromOffset will give you the length and the type
  2130.     kind (BORDEBUG_LF_XXXX) of the type starting at a particular offset.
  2131.     You can use the offset and the type kind to call the appropriate
  2132.     BorDebugTypeXXXX API.
  2133.  
  2134.  
  2135.     typeOffset: file offset in bytes of the type
  2136.     length:     length in bytes of the type
  2137.     typeKind:   BORDEBUG_LF_XXX kind of the type
  2138.  
  2139. */
  2140.  
  2141. void    BorDebugTypeFromOffset(BorDebugCookie registerCookie,
  2142.                                unsigned int   typeOffset,
  2143.                                unsigned int * length,
  2144.                                unsigned int * typeKind);
  2145.  
  2146.  
  2147. //---------------------------------------------------------------------
  2148.  
  2149. /*
  2150.  
  2151.     Type API's
  2152.  
  2153. */
  2154.  
  2155. /*
  2156.  
  2157.     Details of BORDEBUG_LF_STARTYP    = 0x00000000
  2158.  
  2159.     Not a valid type
  2160.  
  2161. */
  2162.  
  2163. /*
  2164.  
  2165.     Details of BORDEBUG_LF_MODIFIER   = 0x00000001
  2166.  
  2167.  
  2168.     BorDebugTypeMODIFIER
  2169.  
  2170.  
  2171.     Specifies if a type is const and/or volatile.
  2172.  
  2173.     typeOffset: file offset in bytes of the type
  2174.     attributes: 0x1 == const, 0x2 == volatile
  2175.     typeIndex:  type index of modified type
  2176.  
  2177. */
  2178.  
  2179. void    BorDebugTypeMODIFIER(BorDebugCookie registerCookie,
  2180.                              unsigned int   typeOffset,
  2181.                              unsigned int * attributes,
  2182.                              unsigned int * typeIndex);
  2183.  
  2184.  
  2185.  
  2186. /*
  2187.  
  2188.     Details of BORDEBUG_LF_POINTER    = 0x00000002
  2189.  
  2190.  
  2191.     BorDebugTypePOINTER
  2192.  
  2193.  
  2194.     Describes pointers, including references, pointers to
  2195.     member data and pointers to member functions.
  2196.  
  2197.  
  2198.     typeOffset:     file offset in bytes of the type
  2199.     attributes:
  2200.                     type modifier of pointer in bits 0 - 4
  2201.                     0 = near
  2202.                     1 = far
  2203.                     2 = huge
  2204.                     3 = based on segment
  2205.                     4 = based on value
  2206.                     5 = based on segment of value
  2207.                     6 = based on address of symbol
  2208.                     7 = based on segment of symbol
  2209.                     8 = based on type
  2210.                     9 = based on self
  2211.                     a = near32
  2212.                     b = far32
  2213.  
  2214.                     mode of pointer in bits 5 - 7
  2215.                     0 pointer
  2216.                     1 reference
  2217.                     2 pointer to data member
  2218.                     3 pointer to function
  2219.  
  2220.                     if bit 8 is on, this is a flat32 pointer
  2221.                     if bit 9 is on, this is a volatile pointer
  2222.                     if bit 10 is on, this is a const pointer
  2223.  
  2224.     typeIndex:      type index of pointed to type
  2225.  
  2226.     value1:         If the pointer mode is 2 or 3, this will
  2227.                     be filled with the class type index
  2228.                     If the pointer type is 3, this will be
  2229.                     filled with the segment
  2230.                     If the pointer type is 8, this will be
  2231.                     filled with a type index
  2232.     value2:         If the pointer mode is 2 or 3, this will
  2233.                     be filled with the member pointer type:
  2234.                      31 = determined by class type
  2235.                      32 = points to single inheritance class
  2236.                      33 = points to multiple inheritance class
  2237.                      34 = points to class with virtual bases
  2238.                     If the pointer type is 8, this will be
  2239.                     filled with a name index
  2240.  
  2241. */
  2242.  
  2243. void    BorDebugTypePOINTER(BorDebugCookie registerCookie,
  2244.                             unsigned int   typeOffset,
  2245.                             unsigned int * attributes,
  2246.                             unsigned int * typeIndex,
  2247.                             unsigned int * value1,
  2248.                             unsigned int * value2);
  2249.  
  2250.  
  2251. /*
  2252.  
  2253.     Details of BORDEBUG_LF_ARRAY      = 0x00000003
  2254.  
  2255.  
  2256.     BorDebugTypeARRAY
  2257.  
  2258.  
  2259.     Describes one dimensional arrays.
  2260.  
  2261.  
  2262.     typeOffset:     file offset in bytes of the type
  2263.     elementType:    type index of elements
  2264.     indexType:      type index of indexer
  2265.     name:           name index of the array name
  2266.     size:           size of the array in bytes
  2267.     elements:       number of elements
  2268.  
  2269. */
  2270.  
  2271. void    BorDebugTypeARRAY(BorDebugCookie registerCookie,
  2272.                           unsigned int   typeOffset,
  2273.                           unsigned int * elementType,
  2274.                           unsigned int * indexType,
  2275.                           unsigned int * name,
  2276.                           unsigned int * size,
  2277.                           unsigned int * elements);
  2278.  
  2279.  
  2280. /*
  2281.  
  2282.     Details of BORDEBUG_LF_CLASS      = 0x00000004
  2283.     Details of BORDEBUG_LF_STRUCT     = 0x00000005
  2284.  
  2285.  
  2286.     BorDebugTypeCLASS
  2287.  
  2288.  
  2289.     Describes classes and structs respectively.
  2290.  
  2291.  
  2292.     typeOffset:         file offset in bytes of the type
  2293.     fieldCount:         number of fields
  2294.                         this includes all bases, members, methods, and friends
  2295.     fieldList:          type index of list of fields
  2296.     property:           bitfield of properties
  2297.         if bit 0 is on, class has a constructor
  2298.         if bit 1 is on, class has overloaded operators
  2299.         if bit 2 is on, class is a nested class
  2300.         if bit 3 is on, class contains nested classes
  2301.         if bit 4 is on, class has overloaded assignment
  2302.         if bit 5 is on, class has casting methods
  2303.         if bit 6 is on, class is a forward (incomplete) reference
  2304.         if bit 7 is on, class has a destructor
  2305.     containingClass:    type index of containing class, if any
  2306.     derivationList:     type index of list of deriving classes
  2307.     vtable:             type index of vtable layout
  2308.     name:               name index of class
  2309.     classSize:          size of class
  2310.  
  2311. */
  2312.  
  2313. void    BorDebugTypeCLASS(BorDebugCookie registerCookie,
  2314.                           unsigned int   typeOffset,
  2315.                           unsigned int * fieldCount,
  2316.                           unsigned int * fieldList,
  2317.                           unsigned int * property,
  2318.                           unsigned int * containingClass,
  2319.                           unsigned int * derivationList,
  2320.                           unsigned int * vtable,
  2321.                           unsigned int * name,
  2322.                           unsigned int * classSize);
  2323.  
  2324.  
  2325. /*
  2326.  
  2327.     Details of BORDEBUG_LF_UNION      = 0x00000006
  2328.  
  2329.  
  2330.     BorDebugTypeUNION
  2331.  
  2332.  
  2333.     Describes unions.
  2334.  
  2335.  
  2336.     typeOffset:         file offset in bytes of the type
  2337.     fieldCount:         number of fields
  2338.     fieldList:          type index of list of fields
  2339.     property:           bitfield of properties (not all are applicable)
  2340.         if bit 0 is on, union has a constructor
  2341.         if bit 1 is on, union has overloaded operators
  2342.         if bit 2 is on, union is a nested union
  2343.         if bit 3 is on, union contains nested classes
  2344.         if bit 4 is on, union has overloaded assignment
  2345.         if bit 5 is on, union has casting methods
  2346.         if bit 6 is on, union is a forward (incomplete) reference
  2347.         if bit 7 is on, union has a destructor
  2348.     containingClass:    type index of containing class, if any
  2349.     name:               name index of class
  2350.     classSize:          size of union
  2351.  
  2352. */
  2353.  
  2354. void    BorDebugTypeUNION(BorDebugCookie registerCookie,
  2355.                           unsigned int   typeOffset,
  2356.                           unsigned int * fieldCount,
  2357.                           unsigned int * fieldList,
  2358.                           unsigned int * property,
  2359.                           unsigned int * containingClass,
  2360.                           unsigned int * name,
  2361.                           unsigned int * classSize);
  2362.  
  2363.  
  2364. /*
  2365.  
  2366.     Details of BORDEBUG_LF_ENUM       = 0x00000007
  2367.  
  2368.  
  2369.     BorDebugTypeENUM
  2370.  
  2371.  
  2372.     Describes enums.
  2373.  
  2374.  
  2375.     typeOffset:         file offset in bytes of the type
  2376.     memberCount:        number of members in the enum
  2377.     underType:          type index of the underlying type of the enum
  2378.     memberList:         type index of list of members
  2379.     containingClass:    type index of containing class, if any
  2380.     name:               name index of the enum
  2381.  
  2382. */
  2383.  
  2384. void    BorDebugTypeENUM(BorDebugCookie registerCookie,
  2385.                          unsigned int   typeOffset,
  2386.                          unsigned int * memberCount,
  2387.                          unsigned int * underType,
  2388.                          unsigned int * memberList,
  2389.                          unsigned int * containingClass,
  2390.                          unsigned int * name);
  2391.  
  2392.  
  2393. /*
  2394.  
  2395.     Details of BORDEBUG_LF_PROCEDURE  = 0x00000008
  2396.  
  2397.  
  2398.     BorDebugTypePROCEDURE
  2399.  
  2400.  
  2401.     Describes global functions and procedures.
  2402.  
  2403.  
  2404.     typeOffset:        file offset in bytes of the type
  2405.     returnType:        type index of return value
  2406.     callingConvention: calling convention in lower 4 bits:
  2407.         0  near C
  2408.         1  far  C
  2409.         2  near Pascal
  2410.         3  far  Pascal
  2411.         4  near Fastcall
  2412.         5  far  Fastcall
  2413.         6  PCode
  2414.         7  near Stdcall
  2415.         8  far  Stdcall
  2416.         9  near Syscall
  2417.         10 far  Syscall
  2418.         11 this call
  2419.         12 near Fastcall (same as 4)
  2420.         13      MS compatible fastcall
  2421.  
  2422.         0x80 bit set : fast this
  2423.         0x40 bit set : variable args
  2424.     argCount:        number of arguments
  2425.     argList:         type index of list of arguments
  2426.  
  2427. */
  2428.  
  2429. void    BorDebugTypePROCEDURE(BorDebugCookie registerCookie,
  2430.                               unsigned int   typeOffset,
  2431.                               unsigned int * returnType,
  2432.                               unsigned int * callingConvention,
  2433.                               unsigned int * argCount,
  2434.                               unsigned int * argList);
  2435.  
  2436.  
  2437. /*
  2438.  
  2439.     Details of BORDEBUG_LF_MFUNCTION  = 0x00000009
  2440.  
  2441.  
  2442.     BorDebugTypeMFUNCTION
  2443.  
  2444.  
  2445.     Describes member functions
  2446.  
  2447.  
  2448.     typeOffset:         file offset in bytes of the type
  2449.     returnType:         type index of return value
  2450.     classType:          type index of the containing class
  2451.     thisType:           type index of this parameter.
  2452.                                 if thisType == NULL, function is static
  2453.     callingConvention:  calling convention in lower 4 bits:
  2454.         0  near C
  2455.         1  far  C
  2456.         2  near Pascal
  2457.         3  far  Pascal
  2458.         4  near Fastcall
  2459.         5  far  Fastcall
  2460.         6  PCode
  2461.         7  near Stdcall
  2462.         8  far  Stdcall
  2463.         9  near Syscall
  2464.         10 far  Syscall
  2465.         11 this call
  2466.         12 near Fastcall (same as 4)
  2467.         13      MS compatible fastcall
  2468.  
  2469.         0x80 bit set : fast this
  2470.         0x40 bit set : variable args
  2471.     argCount:           number of arguments
  2472.     argList:            type index of list of arguments
  2473.     thisAdjust:         offset of function inside class
  2474.  
  2475. */
  2476.  
  2477. void    BorDebugTypeMFUNCTION(BorDebugCookie registerCookie,
  2478.                               unsigned int   typeOffset,
  2479.                               unsigned int * returnType,
  2480.                               unsigned int * classType,
  2481.                               unsigned int * thisType,
  2482.                               unsigned int * callingConvention,
  2483.                               unsigned int * argCount,
  2484.                               unsigned int * argList,
  2485.                               unsigned int * thisAdjust);
  2486.  
  2487.  
  2488. /*
  2489.  
  2490.     Details of BORDEBUG_LF_VTSHAPE    = 0x0000000A
  2491.  
  2492.  
  2493.     BorDebugTypeVTSHAPE
  2494.  
  2495.  
  2496.     Describes virtual function tables.  A class that has a
  2497.     vtable will have a VFUNCTAB as one of its members, and
  2498.     that VFUNCTAB member should be of a POINTER type, and
  2499.     the underlying type of that POINTER type will be a
  2500.     VTSHAPE type.
  2501.  
  2502.  
  2503.     This API should be called twice:
  2504.     The first time, use typeOffset, and set maxCount and
  2505.     descriptorArray to zero, and the count of descriptor
  2506.     entries is returned.
  2507.     The second time, use typeOffset, set MaxCount to the
  2508.     number of entries desired, and point descriptorArray
  2509.     to enough memory for all descriptors wanted.
  2510.  
  2511.     typeOffset:      file offset in bytes of the type
  2512.     maxCount:        max. number of descriptors wanted
  2513.     descriptorArray: points to memory for descriptors
  2514.  
  2515.     descriptor:
  2516.         0               Near
  2517.         1               Far
  2518.         2               Thin
  2519.         3               Address point displacement to outermost class.
  2520.                         This is at entry [-1] from tables address.
  2521.         4               Far pointer to metaclass descriptor.
  2522.                         This is at entry [-2] from table address.
  2523.         5               Near32
  2524.         6               Far32
  2525. */
  2526.  
  2527. unsigned int    BorDebugTypeVTSHAPE(BorDebugCookie  registerCookie,
  2528.                                     unsigned int    typeOffset,
  2529.                                     unsigned int    maxCount,
  2530.                                     unsigned char * descriptorArray);
  2531.  
  2532.  
  2533. /*
  2534.  
  2535.     Details of BORDEBUG_LF_COBOL0     = 0x0000000B
  2536.  
  2537.     Not used
  2538.  
  2539. */
  2540.  
  2541.  
  2542. /*
  2543.  
  2544.     Details of BORDEBUG_LF_COBOL1     = 0x0000000C
  2545.  
  2546.     Not used
  2547.  
  2548. */
  2549.  
  2550.  
  2551. /*
  2552.  
  2553.     Details of BORDEBUG_LF_BARRAY     = 0x0000000D
  2554.  
  2555.     Not used
  2556.  
  2557. */
  2558.  
  2559.  
  2560.  
  2561. /*
  2562.  
  2563.     Details of BORDEBUG_LF_LABEL      = 0x0000000E
  2564.  
  2565.  
  2566.     BorDebugTypeLABEL
  2567.  
  2568.  
  2569.     Describes assembler labels
  2570.  
  2571.  
  2572.     typeOffset: file offset in bytes of the type
  2573.     return:     0 : near label, 4 : far label
  2574.  
  2575. */
  2576.  
  2577. unsigned int    BorDebugTypeLABEL(BorDebugCookie registerCookie,
  2578.                                   unsigned int   typeOffset);
  2579.  
  2580.  
  2581. /*
  2582.  
  2583.     Details of BORDEBUG_LF_NULL       = 0x0000000F
  2584.  
  2585.     Not used
  2586.  
  2587. */
  2588.  
  2589.  
  2590. /*
  2591.  
  2592.     Details of BORDEBUG_LF_NOTTRANS   = 0x00000010
  2593.  
  2594.     Not used
  2595.  
  2596. */
  2597.  
  2598.  
  2599. /*
  2600.  
  2601.     Details of BORDEBUG_LF_DIMARRAY   = 0x00000011
  2602.  
  2603.     Not used
  2604.  
  2605. */
  2606.  
  2607.  
  2608.  
  2609. /*
  2610.  
  2611.     Details of BORDEBUG_LF_VFTPATH    = 0x00000012
  2612.  
  2613.     Not used
  2614.  
  2615. */
  2616.  
  2617.  
  2618. /*
  2619.  
  2620.     Details of BORDEBUG_LF_SET        = 0x00000030
  2621.  
  2622.  
  2623.     BorDebugTypeSET
  2624.  
  2625.  
  2626.     Describes Pascal type sets.
  2627.  
  2628.  
  2629.     typeOffset: file offset in bytes of the type
  2630.     elemType:   type index of elements, could be a subrange type
  2631.     name:       name index of set name
  2632.     lowByte:    first value in set
  2633.     length:     number of elements
  2634.  
  2635. */
  2636.  
  2637. void    BorDebugTypeSET(BorDebugCookie registerCookie,
  2638.                         unsigned int   typeOffset,
  2639.                         unsigned int * elemType,
  2640.                         unsigned int * name,
  2641.                         unsigned int * lowByte,
  2642.                         unsigned int * length);
  2643.  
  2644.  
  2645. /*
  2646.  
  2647.     Details of BORDEBUG_LF_SUBRANGE   = 0x00000031
  2648.  
  2649.  
  2650.     BorDebugTypeSUBRANGE
  2651.  
  2652.  
  2653.     Describes Pascal type subranges.
  2654.  
  2655.  
  2656.     typeOffset: file offset in bytes of the type
  2657.     baseType:   type index of elements
  2658.     name:       name index of subrange name
  2659.     loBound:    low bound
  2660.     hiBound:    high bound
  2661.     size:       size
  2662.  
  2663. */
  2664.  
  2665. void    BorDebugTypeSUBRANGE(BorDebugCookie registerCookie,
  2666.                              unsigned int   typeOffset,
  2667.                              unsigned int * baseType,
  2668.                              unsigned int * name,
  2669.                              unsigned int * loBound,
  2670.                              unsigned int * hiBound,
  2671.                              unsigned int * size);
  2672.  
  2673.  
  2674. /*
  2675.  
  2676.     Details of BORDEBUG_LF_PARRAY     = 0x00000032
  2677.  
  2678.  
  2679.     BorDebugTypePARRAY
  2680.  
  2681.  
  2682.     Describes Pascal style arrays. It is similar to C style
  2683.     arrays, except the indexType could be a subrange.
  2684.  
  2685.  
  2686.     typeOffset:  file offset in bytes of the type
  2687.     elementType: type index of elements
  2688.     indexType:   type index of indexer, could be a subrange type
  2689.     name:        name index of the array name
  2690.     size:        size of the array in bytes
  2691.     elements:    number of elements
  2692.  
  2693. */
  2694.  
  2695. void    BorDebugTypePARRAY(BorDebugCookie registerCookie,
  2696.                            unsigned int   typeOffset,
  2697.                            unsigned int * elementType,
  2698.                            unsigned int * indexType,
  2699.                            unsigned int * name,
  2700.                            unsigned int * size,
  2701.                            unsigned int * elements);
  2702.  
  2703.  
  2704. /*
  2705.  
  2706.     Details of BORDEBUG_LF_PSTRING    = 0x00000033
  2707.  
  2708.  
  2709.     BorDebugTypePSTRING
  2710.  
  2711.  
  2712.     Describes Pascal short strings.
  2713.  
  2714.  
  2715.     typeOffset: file offset in bytes of the type
  2716.     elemType:   type index of elements
  2717.     indexType:  type index of index
  2718.     name:       name index of pstring name
  2719.  
  2720. */
  2721.  
  2722. void    BorDebugTypePSTRING(BorDebugCookie registerCookie,
  2723.                             unsigned int   typeOffset,
  2724.                             unsigned int * elemType,
  2725.                             unsigned int * indexType,
  2726.                             unsigned int * name);
  2727.  
  2728.  
  2729. /*
  2730.  
  2731.     Details of BORDEBUG_LF_CLOSURE    = 0x00000034
  2732.  
  2733.  
  2734.     BorDebugTypeCLOSURE
  2735.  
  2736.  
  2737.     Describes closure's.
  2738.  
  2739.  
  2740.     typeOffset:        file offset in bytes of the type
  2741.     returnType:        type index of return value
  2742.     callingConvention: calling convention in lower 4 bits:
  2743.         0  near C
  2744.         1  far  C
  2745.         2  near Pascal
  2746.         3  far  Pascal
  2747.         4  near Fastcall
  2748.         5  far  Fastcall
  2749.         6  PCode
  2750.         7  near Stdcall
  2751.         8  far  Stdcall
  2752.         9  near Syscall
  2753.         10 far  Syscall
  2754.         11 this call
  2755.         12 near Fastcall (same as 4)
  2756.         13      MS compatible fastcall
  2757.  
  2758.         0x80 bit set : fast this
  2759.         0x40 bit set : variable args
  2760.     argCount:           number of arguments
  2761.     argList:            type index of list of arguments
  2762.  
  2763. */
  2764.  
  2765. void    BorDebugTypeCLOSURE(BorDebugCookie registerCookie,
  2766.                             unsigned int   typeOffset,
  2767.                             unsigned int * returnType,
  2768.                             unsigned int * callingConvention,
  2769.                             unsigned int * argCount,
  2770.                             unsigned int * argList);
  2771.  
  2772.  
  2773. /*
  2774.  
  2775.     Details of BORDEBUG_LF_PROPERTY   = 0x00000035
  2776.  
  2777.  
  2778.     BorDebugTypePROPERTY
  2779.  
  2780.  
  2781.     Describes properties.
  2782.  
  2783.  
  2784.     typeOffset: file offset in bytes of the type
  2785.     propType:   type index of the property
  2786.     flags:      property flags
  2787.         PROPF_DEFAULT       = 1
  2788.         PROPF_READ_IS_NAME  = 2 (read slot is name index)
  2789.         PROPF_WRITE_IS_NAME = 4 (write slot is name index)
  2790.     arrayIndex: type index of BORDEBUG_LF_ARGLIST of array properties
  2791.     propIndex:  index number for indexed properties
  2792.     readSlot:   offset for fields, name index for methods
  2793.     writeSlot:  offset for fields, name index for methods
  2794.  
  2795. */
  2796.  
  2797. void    BorDebugTypePROPERTY(BorDebugCookie registerCookie,
  2798.                              unsigned int   typeOffset,
  2799.                              unsigned int * propType,
  2800.                              unsigned int * flags,
  2801.                              unsigned int * arrayIndex,
  2802.                              unsigned int * propIndex,
  2803.                              unsigned int * readSlot,
  2804.                              unsigned int * writeSlot);
  2805.  
  2806.  
  2807. /*
  2808.  
  2809.     Details of BORDEBUG_LF_LSTRING    = 0x00000036
  2810.  
  2811.  
  2812.     BorDebugTypeLSTRING
  2813.  
  2814.  
  2815.     Describes Pascal long strings.
  2816.  
  2817.  
  2818.     typeOffset: file offset in bytes of the type
  2819.     return:     name index of string
  2820.  
  2821. */
  2822.  
  2823. unsigned int    BorDebugTypeLSTRING(BorDebugCookie registerCookie,
  2824.                                     unsigned int   typeOffset);
  2825.  
  2826.  
  2827. /*
  2828.  
  2829.     Details of BORDEBUG_LF_VARIANT    = 0x00000037
  2830.  
  2831.  
  2832.     BorDebugTypeVARIANT
  2833.  
  2834.  
  2835.     Describes variants.
  2836.  
  2837.  
  2838.     typeOffset: file offset in bytes of the type
  2839.     return:     name index of variant
  2840.  
  2841. */
  2842.  
  2843. unsigned int    BorDebugTypeVARIANT(BorDebugCookie registerCookie,
  2844.                                     unsigned int   typeOffset);
  2845.  
  2846.  
  2847. /*
  2848.  
  2849.     Details of BORDEBUG_LF_CLASSREF   = 0x00000038
  2850.  
  2851.  
  2852.     BorDebugTypeCLASSREF
  2853.  
  2854.  
  2855.     Describes Pascal class references.
  2856.  
  2857.  
  2858.     typeOffset: file offset in bytes of the type
  2859.     refType:    type index of referred class
  2860.     vtShape:    type index of vtable shape
  2861.  
  2862. */
  2863.  
  2864. void    BorDebugTypeCLASSREF(BorDebugCookie registerCookie,
  2865.                              unsigned int   typeOffset,
  2866.                              unsigned int * refType,
  2867.                              unsigned int * vtShape);
  2868.  
  2869.  
  2870. /*
  2871.  
  2872.     Details of BORDEBUG_LF_WSTRING    = 0x00000039
  2873.  
  2874.  
  2875.     BorDebugTypeWSTRING
  2876.  
  2877.  
  2878.     Describes Pascal wide strings.
  2879.  
  2880.  
  2881.     typeOffset: file offset in bytes of the type
  2882.     return:     name index of string
  2883.  
  2884. */
  2885.  
  2886. unsigned int    BorDebugTypeWSTRING(BorDebugCookie registerCookie,
  2887.                                     unsigned int   typeOffset);
  2888.  
  2889.  
  2890. /*
  2891.  
  2892.     Details of BORDEBUG_LF_SKIP      = 0x00000200
  2893.  
  2894.     Not used
  2895.  
  2896. */
  2897.  
  2898.  
  2899. /*
  2900.  
  2901.     Details of BORDEBUG_LF_ARGLIST    = 0x00000201
  2902.  
  2903.  
  2904.     BorDebugTypeARGLIST
  2905.  
  2906.  
  2907.     Describes argument lists of functions and methods.
  2908.     The type API's for methods, closures and functions
  2909.     will return a type index for the argument list, and
  2910.     this type index will belong to an ARGLIST type.
  2911.  
  2912.  
  2913.     This API has to be called twice:
  2914.     The first time, fill in typeOffset and set maxTypes
  2915.     and typeIndexArray to zero.  The number of arguments is
  2916.     returned.
  2917.     The second time, fill in typeOffset, set maxTypes to
  2918.     the max. number of type indices you want, and point
  2919.     typeIndexArray to enough valid memory.  On return,
  2920.     the typeIndexArray will be filled with type indices
  2921.     for all the arguments.
  2922.  
  2923.     typeOffset:     file offset in bytes of the type
  2924.     maxTypes:       max. number of argument type indices wanted
  2925.     typeIndexArray: points to memory to receive argument type indices
  2926.  
  2927. */
  2928.  
  2929. unsigned int    BorDebugTypeARGLIST(BorDebugCookie registerCookie,
  2930.                                     unsigned int   typeOffset,
  2931.                                     unsigned int   maxTypes,
  2932.                                     unsigned int * typeIndexArray);
  2933.  
  2934.  
  2935. /*
  2936.  
  2937.     Details of BORDEBUG_LF_DEFARG     = 0x00000202
  2938.  
  2939.     Not used.
  2940.  
  2941. */
  2942.  
  2943.  
  2944.  
  2945.  
  2946. /*
  2947.  
  2948.     Details of BORDEBUG_LF_LIST      = 0x00000203
  2949.  
  2950.     Not used
  2951.  
  2952. */
  2953.  
  2954.  
  2955.  
  2956. /*
  2957.  
  2958.     Details of BORDEBUG_LF_FIELDLIST  = 0x00000204
  2959.  
  2960.  
  2961.     BorDebugTypeFIELDLIST
  2962.  
  2963.  
  2964.     Describes the members of a class, struct, union, or enum.
  2965.     This list includes base classes and vtable descriptors.
  2966.  
  2967.  
  2968.     A FIELDLIST can only be accessed serially, due to the fact
  2969.     that the length of each field is not stored, so each field
  2970.     has to be extracted before we can skip to the next one.
  2971.  
  2972.     First, BorDebugTypeStartFIELDLIST has to be called to set
  2973.     up the serial traversing of the fields.
  2974.     Next, keep calling BorDebugTypeNextFIELDLIST till both the
  2975.     kind and the offset fields receive zero.
  2976.  
  2977.     It is possible that the field list is split up into multiple
  2978.     parts.  If this is the case, each FIELDLIST will have a
  2979.     BORDEBUG_LF_INDEX as its last member.  To continue going
  2980.     through the fields, get the type index out of the
  2981.     BORDEBUG_LF_INDEX by using BorDebugTypeINDEX, and start
  2982.     a new FIELDLIST, e.g.:
  2983.  
  2984.     // start the field list
  2985.     BorDebugTypeStartFIELDLIST(cookie, offset);
  2986.     while (1)
  2987.     {
  2988.         // next field
  2989.         BorDebugTypeNextFIELDLIST(cookie, &kind, &offset);
  2990.  
  2991.         // are we done
  2992.         if  (kind == 0 && offset == 0)
  2993.             break;
  2994.  
  2995.         // is this a continuation
  2996.         if  (kind == BORDEBUG_LF_INDEX)
  2997.         {
  2998.             // get the continuation index and its offset
  2999.             contIndex = BorDebugTypeINDEX(cookie, offset);
  3000.             BorDebugTypeFromIndex(cookie, contIndex, &offset, &len, &kind);
  3001.  
  3002.             // continue in the next field list
  3003.             BorDebugTypeStartFIELDLIST(cookie, offset);
  3004.             continue;
  3005.         }
  3006.  
  3007.         // process the type
  3008.     }
  3009.  
  3010.  
  3011.     To find out more information about each member type, call
  3012.     into the relevant BorDebugTypeXXXX API, based on the kind.
  3013.  
  3014.  
  3015.     typeOffset: file offset in bytes of the field list type
  3016.  
  3017.     kind:       receives the kind of the next field
  3018.     offset:     receives the offset of the next field
  3019. */
  3020.  
  3021. void    BorDebugTypeStartFIELDLIST(BorDebugCookie registerCookie,
  3022.                                    unsigned int   typeOffset);
  3023.  
  3024.  
  3025. void    BorDebugTypeNextFIELDLIST(BorDebugCookie registerCookie,
  3026.                                   unsigned int * kind,
  3027.                                   unsigned int * offset);
  3028.  
  3029.  
  3030.  
  3031. /*
  3032.  
  3033.     Details of BORDEBUG_LF_DERIVED    = 0x00000205
  3034.  
  3035.  
  3036.     BorDebugTypeDERIVED
  3037.  
  3038.  
  3039.     Describes all the classes that are directly derived from a
  3040.     class.  The class type will have a type index for its derivation
  3041.     list, which should have BORDEBUG_LF_DERIVED type kind.
  3042.  
  3043.  
  3044.     This API has to be called twice:
  3045.     The first time, use the correct typeOffset, and set maxTypes and
  3046.     derivedTypes to zero, and the total number of derived types is
  3047.     returned.
  3048.     The second time, set maxTypes to the number of types wanted, and
  3049.     point derivedTypes to enough allocated memory to hold all the
  3050.     type indices.  On return the type array is filled in.
  3051.  
  3052.     typeOffset:     file offset in bytes of the type
  3053.     maxTypes:       max. number of type indices wanted
  3054.     derivedTypes:   allocated array for type indices
  3055.  
  3056.     returns the total number of derived types.
  3057.  
  3058. */
  3059.  
  3060. unsigned int    BorDebugTypeDERIVED(BorDebugCookie registerCookie,
  3061.                                     unsigned int   typeOffset,
  3062.                                     unsigned int   maxTypes,
  3063.                                     unsigned int * derivedTypes);
  3064.  
  3065.  
  3066.  
  3067. /*
  3068.  
  3069.     Details of BORDEBUG_LF_BITFIELD   = 0x00000206
  3070.  
  3071.  
  3072.     BorDebugTypeBITFIELD
  3073.  
  3074.  
  3075.     Describes bitfields.
  3076.  
  3077.  
  3078.     typeOffset: file offset in bytes of the type
  3079.     length:     length in bits
  3080.     position:   starting position (zero based) in object
  3081.     typeIndex:  type index of variable
  3082.  
  3083. */
  3084.  
  3085. void    BorDebugTypeBITFIELD(BorDebugCookie registerCookie,
  3086.                              unsigned int   typeOffset,
  3087.                              unsigned int * length,
  3088.                              unsigned int * position,
  3089.                              unsigned int * typeIndex);
  3090.  
  3091.  
  3092. /*
  3093.  
  3094.     Details of BORDEBUG_LF_METHODLIST = 0x00000207
  3095.  
  3096.  
  3097.     BorDebugTypeMETHODLIST
  3098.  
  3099.  
  3100.     Describes functions and procedures.  For non-overloaded
  3101.     functions, the methodlist will contain one entry, and for
  3102.     overloaded functions there will be multiple entries.
  3103.  
  3104.  
  3105.     This API has to be called twice
  3106.     The first time, fill in typeOffset, and
  3107.     set the other fields to zero.  The total
  3108.     number of methods is returned. The second
  3109.     time, set maxMethods to the max. number of
  3110.     methods wanted, and point the 4 arrays to
  3111.     enough memory to hold the details of all the
  3112.     methods wanted.
  3113.  
  3114.     For each method, you can get more information from the
  3115.     type index of the method.  Use BorDebugTypeFromIndex to get
  3116.     the offset and the type kind, and call the relevant
  3117.     BorDebugTypeXXXX function to get more information
  3118.     about the type
  3119.  
  3120.     typeOffset:   file offset in bytes of the type
  3121.     maxMethods:   the max. number of methods wanted
  3122.     typeArray:    filled in with type indices
  3123.     attribArray:  filled in with attributes
  3124.         access:  2 bits for access
  3125.                  0 no access protection
  3126.                  1 private access
  3127.                  2 protected access
  3128.                  3 public access
  3129.         mprop:   3 bits for properties
  3130.                  0 vanilla
  3131.                  1 virtual
  3132.                  2 static
  3133.                  3 friend
  3134.                  4 introducing virtual
  3135.                  5 pure virtual
  3136.                  6 pure introducing virtual
  3137.                  7 reserved
  3138.     browserArray: filled in with browser offsets
  3139.     vtabOffArray: filled in with vtable offsets, if any
  3140.         if mprop == 4 || mprop == 6, vtable offset is filled in
  3141.         otherwise it's zero
  3142.  
  3143. */
  3144.  
  3145. unsigned int    BorDebugTypeMETHODLIST(BorDebugCookie registerCookie,
  3146.                                        unsigned int   typeOffset,
  3147.                                        unsigned int   maxMethods,
  3148.                                        unsigned int * typeArray,
  3149.                                        unsigned int * attribArray,
  3150.                                        unsigned int * browserArray,
  3151.                                        unsigned int * vtabOffArray);
  3152.  
  3153.  
  3154. /*
  3155.  
  3156.     Details of BORDEBUG_LF_DIMCONU    = 0x00000208
  3157.  
  3158.     Not used
  3159.  
  3160. */
  3161.  
  3162.  
  3163. /*
  3164.  
  3165.     Details of BORDEBUG_LF_DIMCONLU   = 0x00000209
  3166.  
  3167.     Not used
  3168.  
  3169. */
  3170.  
  3171.  
  3172. /*
  3173.  
  3174.     Details of BORDEBUG_LF_DIMVARU    = 0x0000020A
  3175.  
  3176.     Not used
  3177.  
  3178. */
  3179.  
  3180.  
  3181. /*
  3182.  
  3183.     Details of BORDEBUG_LF_DIMVARLU   = 0x0000020B
  3184.  
  3185.     Not used
  3186.  
  3187. */
  3188.  
  3189.  
  3190. /*
  3191.  
  3192.     Details of BORDEBUG_LF_REFSYM     = 0x0000020C
  3193.  
  3194.     Not used
  3195.  
  3196. */
  3197.  
  3198.  
  3199. /*
  3200.  
  3201.     Details of BORDEBUG_LF_BCLASS     = 0x00000400
  3202.  
  3203.  
  3204.     BorDebugTypeBCLASS
  3205.  
  3206.  
  3207.     Describes non virtual base classes.
  3208.  
  3209.  
  3210.     typeOffset: file offset in bytes of the type
  3211.     baseType:   type index of base class
  3212.     attrib:     attributes
  3213.         access:  bits 0 - 1 for access
  3214.                  0 no access protection
  3215.                  1 private access
  3216.                  2 protected access
  3217.                  3 public access
  3218.         mprop:   bit 2 - 4 for properties
  3219.                  0 vanilla
  3220.                  1 virtual
  3221.                  2 static
  3222.                  3 friend
  3223.                  4 introducing virtual
  3224.                  5 pure virtual
  3225.                  6 pure introducing virtual
  3226.                  7 reserved
  3227.     offset:     offset in derived class
  3228.  
  3229. */
  3230.  
  3231. void    BorDebugTypeBCLASS(BorDebugCookie registerCookie,
  3232.                            unsigned int   typeOffset,
  3233.                            unsigned int * baseType,
  3234.                            unsigned int * attrib,
  3235.                            unsigned int * offset);
  3236.  
  3237.  
  3238.  
  3239. /*
  3240.  
  3241.     Details of BORDEBUG_LF_VBCLASS    = 0x00000401
  3242.  
  3243.  
  3244.     BorDebugTypeVBCLASS
  3245.  
  3246.  
  3247.     Describes the virtual base of a class, with the
  3248.     restriction that the trail from the class to the
  3249.     virtual base is composed of zero or more virtual
  3250.     base classes.  If any of the base classes is non
  3251.     virtual, the type would be BORDEBUG_LF_IVBCLASS
  3252.     (0x00000402).
  3253.  
  3254.  
  3255.     typeOffset: file offset in bytes of the type
  3256.     vbType:     type index of virtual base class
  3257.     vbptype:    type index of virtual base pointer
  3258.     attrib:     attributes
  3259.         access:  bits 0 - 1 for access
  3260.                  0 no access protection
  3261.                  1 private access
  3262.                  2 protected access
  3263.                  3 public access
  3264.         mprop:   bit 2 - 4 for properties
  3265.                  0 vanilla
  3266.                  1 virtual
  3267.                  2 static
  3268.                  3 friend
  3269.                  4 introducing virtual
  3270.                  5 pure virtual
  3271.                  6 pure introducing virtual
  3272.                  7 reserved
  3273.     vbpOffset:   offset of virtual base pointer in derived class
  3274.     offset:      offset in derived class, relative to class + vbpOffset
  3275.  
  3276. */
  3277.  
  3278. void    BorDebugTypeVBCLASS(BorDebugCookie registerCookie,
  3279.                             unsigned int   typeOffset,
  3280.                             unsigned int * vbType,
  3281.                             unsigned int * vbptype,
  3282.                             unsigned int * attrib,
  3283.                             unsigned int * vbpOffset,
  3284.                             unsigned int * offset);
  3285.  
  3286.  
  3287. /*
  3288.  
  3289.     Details of BORDEBUG_LF_IVBCLASS   = 0x00000402
  3290.  
  3291.  
  3292.     BorDebugTypeIVBCLASS
  3293.  
  3294.  
  3295.     Describes the indirect virtual base of a class, with
  3296.     the restriction that the trail from the class to the
  3297.     virtual base has at least one non-virtual base.  If
  3298.     all of the base classes are virtual, the type would
  3299.     be BORDEBUG_LF_VBCLASS (0x00000401).
  3300.  
  3301.  
  3302.     typeOffset: file offset in bytes of the type
  3303.     vbType:     type index of virtual base class
  3304.     vbpType:    type index of virtual base pointer
  3305.     attrib:     attributes
  3306.         access:  bits 0 - 1 for access
  3307.                  0 no access protection
  3308.                  1 private access
  3309.                  2 protected access
  3310.                  3 public access
  3311.         mprop:   bit 2 - 4 for properties
  3312.                  0 vanilla
  3313.                  1 virtual
  3314.                  2 static
  3315.                  3 friend
  3316.                  4 introducing virtual
  3317.                  5 pure virtual
  3318.                  6 pure introducing virtual
  3319.                  7 reserved
  3320.     vbpOffset:   offset of virtual base pointer in derived class
  3321.     offset:      offset in derived class, relative to class + vbpOffset
  3322.  
  3323. */
  3324.  
  3325. void    BorDebugTypeIVBCLASS(BorDebugCookie registerCookie,
  3326.                              unsigned int   typeOffset,
  3327.                              unsigned int * vbType,
  3328.                              unsigned int * vbpType,
  3329.                              unsigned int * attrib,
  3330.                              unsigned int * vbpOffset,
  3331.                              unsigned int * offset);
  3332.  
  3333.  
  3334. /*
  3335.  
  3336.     Details of BORDEBUG_LF_ENUMERATE  = 0x00000403
  3337.  
  3338.  
  3339.     BorDebugTypeENUMERATE
  3340.  
  3341.  
  3342.     Describes the member (enumerate) of an enum.  The enum type will
  3343.     have a type index for its fieldlist, and that fieldlist will
  3344.     contain members of the enumerate type.
  3345.  
  3346.  
  3347.     typeOffset:    file offset in bytes of the type
  3348.     attrib:        not used right now
  3349.     name:          name index of enum member
  3350.     browserOffset: browser offset of enum member
  3351.     value:         value of enum member
  3352.  
  3353. */
  3354.  
  3355. void    BorDebugTypeENUMERATE(BorDebugCookie registerCookie,
  3356.                               unsigned int   typeOffset,
  3357.                               unsigned int * attrib,
  3358.                               unsigned int * name,
  3359.                               unsigned int * browserOffset,
  3360.                               unsigned int * value);
  3361.  
  3362.  
  3363. /*
  3364.  
  3365.     Details of BORDEBUG_LF_FRIENDFCN  = 0x00000404
  3366.  
  3367.  
  3368.     BorDebugTypeFRIENDFCN
  3369.  
  3370.  
  3371.     Describes a friend function.
  3372.  
  3373.  
  3374.     typeOffset: file offset in bytes of the type
  3375.     typeIndex:  type index of the friend function
  3376.     name:       name index of friend function
  3377.  
  3378. */
  3379.  
  3380. void    BorDebugTypeFRIENDFCN(BorDebugCookie registerCookie,
  3381.                               unsigned int   typeOffset,
  3382.                               unsigned int * typeIndex,
  3383.                               unsigned int * name);
  3384.  
  3385.  
  3386. /*
  3387.  
  3388.     Details of BORDEBUG_LF_INDEX      = 0x00000405
  3389.  
  3390.  
  3391.     BorDebugTypeINDEX
  3392.  
  3393.  
  3394.     Describes a continuation type index.  This is used for instance
  3395.     in the FIELDLIST type, if the list of fields is too long and
  3396.     has to be split into multiple FIELDLIST's.  Each continuation
  3397.     type points to the next FIELDLIST.
  3398.  
  3399.  
  3400.     typeOffset: file offset in bytes of the type
  3401.     return:     continuation type index
  3402.  
  3403. */
  3404.  
  3405. unsigned int    BorDebugTypeINDEX(BorDebugCookie registerCookie,
  3406.                                   unsigned int   typeOffset);
  3407.  
  3408.  
  3409.  
  3410. /*
  3411.  
  3412.     Details of BORDEBUG_LF_MEMBER     = 0x00000406
  3413.  
  3414.  
  3415.     BorDebugTypeMEMBER
  3416.  
  3417.  
  3418.     Describes non-static data members of classes, structs,
  3419.     and unions.
  3420.  
  3421.  
  3422.     typeOffset:    file offset in bytes of the type
  3423.     typeIndex:     type index of member
  3424.     attrib:        attributes of member
  3425.         access:  bits 0 - 1 for access
  3426.                  0 no access protection
  3427.                  1 private access
  3428.                  2 protected access
  3429.                  3 public access
  3430.         mprop:   bit 2 - 4 for properties
  3431.                  0 vanilla
  3432.                  1 virtual
  3433.                  2 static
  3434.                  3 friend
  3435.                  4 introducing virtual
  3436.                  5 pure virtual
  3437.                  6 pure introducing virtual
  3438.                  7 reserved
  3439.     name:          name index of member
  3440.     offset:        offset of member inside structure
  3441.     browserOffset: browser Offset of member
  3442.  
  3443. */
  3444.  
  3445. void    BorDebugTypeMEMBER(BorDebugCookie registerCookie,
  3446.                            unsigned int   typeOffset,
  3447.                            unsigned int * typeIndex,
  3448.                            unsigned int * attrib,
  3449.                            unsigned int * name,
  3450.                            unsigned int * offset,
  3451.                            unsigned int * browserOffset);
  3452.  
  3453.  
  3454. /*
  3455.  
  3456.     Details of BORDEBUG_LF_STMEMBER   = 0x00000407
  3457.  
  3458.  
  3459.     BorDebugTypeSTMEMBER
  3460.  
  3461.  
  3462.     Describes static data members of classes, structs, and
  3463.     unions.  To find the symbol belonging to a static data
  3464.     member, find its name, and qualify it with the name of
  3465.     its containing class, as in class::staticMember, and
  3466.     search for a symbol with this name and the correct
  3467.     type index.
  3468.  
  3469.  
  3470.     typeOffset:     file offset in bytes of the type
  3471.     typeIndex:      type index of static member
  3472.     attrib:         attributes of static member
  3473.         access:  bits 0 - 1 for access
  3474.                  0 no access protection
  3475.                  1 private access
  3476.                  2 protected access
  3477.                  3 public access
  3478.         mprop:   bit 2 - 4 for properties
  3479.                  0 vanilla
  3480.                  1 virtual
  3481.                  2 static
  3482.                  3 friend
  3483.                  4 introducing virtual
  3484.                  5 pure virtual
  3485.                  6 pure introducing virtual
  3486.                  7 reserved
  3487.     name:           name index of static member
  3488.     browserOffset:  browser Offset of static member
  3489.  
  3490. */
  3491.  
  3492. void    BorDebugTypeSTMEMBER(BorDebugCookie registerCookie,
  3493.                              unsigned int   typeOffset,
  3494.                              unsigned int * typeIndex,
  3495.                              unsigned int * attrib,
  3496.                              unsigned int * name,
  3497.                              unsigned int * browserOffset);
  3498.  
  3499.  
  3500. /*
  3501.  
  3502.     Details of BORDEBUG_LF_METHOD     = 0x00000408
  3503.  
  3504.  
  3505.     BorDebugTypeMETHOD
  3506.  
  3507.  
  3508.     Describes the member functions of a class.  The type
  3509.     index of the methodlist points to a METHODLIST,
  3510.     which contains one or more types of functions.
  3511.  
  3512.  
  3513.     typeOffset: file offset in bytes of the type
  3514.     count:      number of (overloaded) functions
  3515.     methodList: type index of method list
  3516.     name:       name index of method
  3517.  
  3518. */
  3519.  
  3520. void    BorDebugTypeMETHOD(BorDebugCookie registerCookie,
  3521.                            unsigned int   typeOffset,
  3522.                            unsigned int * count,
  3523.                            unsigned int * methodList,
  3524.                            unsigned int * name);
  3525.  
  3526.  
  3527.  
  3528. /*
  3529.  
  3530.     Details of BORDEBUG_LF_NESTTYPE   = 0x00000409
  3531.  
  3532.  
  3533.     BorDebugTypeNESTTYPE
  3534.  
  3535.  
  3536.     Describes nested types inside classes, structs, unions, and
  3537.     enums.  The containing class will have a member that is of
  3538.     type NESTTYPE, and its type index will point to the record
  3539.     of the nested type.
  3540.  
  3541.  
  3542.     typeOffset:    file offset in bytes of the type
  3543.     typeIndex:     type index of nested type
  3544.     name:          name index of nested type
  3545.     browserOffset: browser offset of nested type
  3546.  
  3547. */
  3548.  
  3549. void    BorDebugTypeNESTTYPE(BorDebugCookie registerCookie,
  3550.                              unsigned int   typeOffset,
  3551.                              unsigned int * typeIndex,
  3552.                              unsigned int * name,
  3553.                              unsigned int * browserOffset);
  3554.  
  3555.  
  3556. /*
  3557.  
  3558.     Details of BORDEBUG_LF_VFUNCTAB   = 0x0000040A
  3559.  
  3560.  
  3561.     BorDebugTypeVFUNCTAB
  3562.  
  3563.  
  3564.     Describes the virtual table pointers in a class.  A class
  3565.     can have a member of type VFUNCTAB, which will be a POINTER
  3566.     type, and the pointed to type will be a VTSHAPE type.
  3567.     It is usually emitted as the first member of a class.
  3568.  
  3569.  
  3570.     typeOffset: file offset in bytes of the type
  3571.     typeIndex:  type index of vtable pointer
  3572.     offset:     offset of vtable pointer in derived class
  3573.  
  3574. */
  3575.  
  3576. void    BorDebugTypeVFUNCTAB(BorDebugCookie registerCookie,
  3577.                              unsigned int   typeOffset,
  3578.                              unsigned int * typeIndex,
  3579.                              unsigned int * offset);
  3580.  
  3581.  
  3582. /*
  3583.  
  3584.     Details of BORDEBUG_LF_FRIENDCLS  = 0x0000040B
  3585.  
  3586.  
  3587.     BorDebugTypeFRIENDCLS
  3588.  
  3589.  
  3590.     Describes a friend class.  A class can have a member that
  3591.     is of type FRIENDCLS, and its type index points to the
  3592.     actual type record of the friend class.
  3593.  
  3594.  
  3595.     typeOffset: file offset in bytes of the type
  3596.     return:     type index of the friend class
  3597.  
  3598. */
  3599.  
  3600. unsigned int    BorDebugTypeFRIENDCLS(BorDebugCookie registerCookie,
  3601.                                       unsigned int   typeOffset);
  3602.  
  3603.  
  3604.  
  3605. /*
  3606.  
  3607.     Details of BORDEBUG_LF_CHAR       = 0x00008000
  3608.  
  3609.  
  3610.     BorDebugTypeCHAR
  3611.  
  3612.  
  3613.     Describes char's and unsigned char's.
  3614.     In this implementation you will not encounter this type.
  3615.  
  3616.  
  3617.     typeOffset: file offset in bytes of the type
  3618.     return:     value of the char
  3619.  
  3620. */
  3621.  
  3622. char    BorDebugTypeCHAR(BorDebugCookie registerCookie,
  3623.                          unsigned int   typeOffset);
  3624.  
  3625.  
  3626. /*
  3627.  
  3628.     Details of BORDEBUG_LF_SHORT      = 0x00008001
  3629.  
  3630.  
  3631.     BorDebugTypeSHORT
  3632.  
  3633.  
  3634.     Describes short's.
  3635.     In this implementation you will not encounter this type.
  3636.  
  3637.  
  3638.     typeOffset: file offset in bytes of the type
  3639.     return:     value of the short
  3640.  
  3641. */
  3642.  
  3643. short   BorDebugTypeSHORT(BorDebugCookie registerCookie,
  3644.                           unsigned int   typeOffset);
  3645.  
  3646.  
  3647. /*
  3648.  
  3649.     Details of BORDEBUG_LF_USHORT     = 0x00008002
  3650.  
  3651.  
  3652.     BorDebugTypeUSHORT
  3653.  
  3654.  
  3655.     Describes unsigned short's.
  3656.     In this implementation you will not encounter this type.
  3657.  
  3658.  
  3659.     typeOffset: file offset in bytes of the type
  3660.     return:     value of the unsigned short
  3661.  
  3662. */
  3663.  
  3664. unsigned short  BorDebugTypeUSHORT(BorDebugCookie registerCookie,
  3665.                                    unsigned int   typeOffset);
  3666.  
  3667.  
  3668. /*
  3669.  
  3670.     Details of BORDEBUG_LF_LONG       = 0x00008003
  3671.  
  3672.  
  3673.     BorDebugTypeLONG
  3674.  
  3675.  
  3676.     Describes long's.
  3677.     In this implementation you will not encounter this type.
  3678.  
  3679.     typeOffset: file offset in bytes of the type
  3680.     return:     value of the long
  3681.  
  3682. */
  3683.  
  3684. long    BorDebugTypeLONG(BorDebugCookie registerCookie,
  3685.                          unsigned int   typeOffset);
  3686.  
  3687.  
  3688. /*
  3689.  
  3690.     Details of BORDEBUG_LF_ULONG      = 0x00008004
  3691.  
  3692.  
  3693.     BorDebugTypeULONG
  3694.  
  3695.  
  3696.     Describes unsigned long's.
  3697.     In this implementation you will not encounter this type.
  3698.  
  3699.  
  3700.     typeOffset: file offset in bytes of the type
  3701.     return:     value of the unsigned long
  3702.  
  3703. */
  3704.  
  3705. unsigned long   BorDebugTypeULONG(BorDebugCookie registerCookie,
  3706.                                   unsigned int   typeOffset);
  3707.  
  3708.  
  3709. /*
  3710.  
  3711.     Details of BORDEBUG_LF_REAL32     = 0x00008005
  3712.  
  3713.  
  3714.     BorDebugTypeREAL32
  3715.  
  3716.  
  3717.     Describes 32 bit float's.
  3718.  
  3719.  
  3720.     typeOffset: file offset in bytes of the type
  3721.     return:     value of the real32
  3722.  
  3723. */
  3724.  
  3725. float   BorDebugTypeREAL32(BorDebugCookie registerCookie,
  3726.                            unsigned int   typeOffset);
  3727.  
  3728.  
  3729. /*
  3730.  
  3731.     Details of BORDEBUG_LF_REAL64     = 0x00008006
  3732.  
  3733.  
  3734.     BorDebugTypeREAL64
  3735.  
  3736.  
  3737.     Describes 64 bit float's (double's).
  3738.  
  3739.  
  3740.     typeOffset: file offset in bytes of the type
  3741.     return:     value of the real64
  3742.  
  3743. */
  3744.  
  3745. double  BorDebugTypeREAL64(BorDebugCookie registerCookie,
  3746.                            unsigned int   typeOffset);
  3747.  
  3748.  
  3749. /*
  3750.  
  3751.     Details of BORDEBUG_LF_REAL80     = 0x00008007
  3752.  
  3753.  
  3754.     BorDebugTypeREAL80
  3755.  
  3756.  
  3757.     Describes 80 bit float's (long double's).
  3758.  
  3759.  
  3760.     typeOffset: file offset in bytes of the type
  3761.     return:     value of the real80
  3762.  
  3763. */
  3764.  
  3765. long double     BorDebugTypeREAL80(BorDebugCookie registerCookie,
  3766.                                    unsigned int   typeOffset);
  3767.  
  3768.  
  3769. /*
  3770.  
  3771.     Details of BORDEBUG_LF_REAL128    = 0x00008008
  3772.  
  3773.     Not used
  3774.  
  3775. */
  3776.  
  3777.  
  3778. /*
  3779.  
  3780.     Details of BORDEBUG_LF_QUADWORD   = 0x00008009
  3781.  
  3782.  
  3783.     BorDebugTypeQUADWORD
  3784.  
  3785.  
  3786.     Describes 64 bit values.
  3787.  
  3788.  
  3789.     typeOffset: file offset in bytes of the type
  3790.     return:     value of quad word
  3791.  
  3792. */
  3793.  
  3794. __int64 BorDebugTypeQUADWORD(BorDebugCookie registerCookie,
  3795.                              unsigned int   typeOffset);
  3796.  
  3797.  
  3798. /*
  3799.  
  3800.     Details of BORDEBUG_LF_UQUADWORD  = 0x0000800A
  3801.  
  3802.  
  3803.     BorDebugTypeUQUADWORD
  3804.  
  3805.  
  3806.     Describes unsigned 64 bit values.
  3807.  
  3808.  
  3809.     typeOffset: file offset in bytes of the type
  3810.     return:     value of uquad word
  3811.  
  3812. */
  3813.  
  3814. unsigned __int64 BorDebugTypeUQUADWORD(BorDebugCookie registerCookie,
  3815.                                        unsigned int   typeOffset);
  3816.  
  3817.  
  3818. /*
  3819.  
  3820.     Details of BORDEBUG_LF_REAL48     = 0x0000800B
  3821.  
  3822.  
  3823.     BorDebugTypeREAL48
  3824.  
  3825.  
  3826.     Describes 48 bit Pascal type float's
  3827.  
  3828.  
  3829.     typeOffset: file offset in bytes of the type
  3830.     return:     value of the real48
  3831.  
  3832. */
  3833.  
  3834. double  BorDebugTypeREAL48(BorDebugCookie registerCookie,
  3835.                            unsigned int   typeOffset);
  3836.  
  3837.  
  3838. //---------------------------------------------------------------------
  3839.  
  3840. /*
  3841.  
  3842.     sstNames API's
  3843.  
  3844.     Use the name index API's to retrieve the names.
  3845.     Remember:  the names are 1 - based.
  3846.  
  3847. */
  3848.  
  3849.  
  3850. /*
  3851.  
  3852.     BorDebugNamesTotalNames
  3853.  
  3854.     Return the total number of names in the sstNames subsection
  3855.  
  3856.     return:     the total number of names
  3857. */
  3858.  
  3859.  
  3860. unsigned int    BorDebugNamesTotalNames(BorDebugCookie registerCookie);
  3861.  
  3862.  
  3863.  
  3864. //---------------------------------------------------------------------
  3865.  
  3866. /*
  3867.  
  3868.     Index API's
  3869.  
  3870. */
  3871.  
  3872.  
  3873. /*
  3874.  
  3875.     BorDebugNameIndexToUnmangedName
  3876.  
  3877.  
  3878.     Go from an index to the name as it appears in the
  3879.     debug info, and always unmangle the name if it
  3880.     is mangled.
  3881.     Buf is assumed to point to a buffer of at least
  3882.     bufLen characters.
  3883.     A buffer of 1024 char's is enough for most names
  3884.  
  3885.     name:   name index
  3886.     buf:    points to array of char's
  3887.     bufLen: size of buf array
  3888.  
  3889. */
  3890.  
  3891.  
  3892. void    BorDebugNameIndexToUnmangledName(BorDebugCookie registerCookie,
  3893.                                          unsigned int   name,
  3894.                                          char         * buf,
  3895.                                          unsigned int   bufLen);
  3896.  
  3897. /*
  3898.  
  3899.     BorDebugNameIndexToName
  3900.  
  3901.  
  3902.     Go from an index to the name as it appears in the
  3903.     debug info.  This might be a mangled name.
  3904.     Buf is assumed to point to a buffer of at least
  3905.     bufLen characters.
  3906.     A buffer of 260 char's is enough for all names
  3907.  
  3908.     name:   name index
  3909.     buf:    points to array of char's
  3910.     bufLen: size of buf array
  3911.  
  3912. */
  3913.  
  3914. void    BorDebugNameIndexToName(BorDebugCookie registerCookie,
  3915.                                 unsigned int   name,
  3916.                                 char         * buf,
  3917.                                 unsigned int   bufLen);
  3918.  
  3919. /*
  3920.  
  3921.     BorDebugRegIndexToName
  3922.  
  3923.  
  3924.     Go from an index to the name of a register.
  3925.     Buf is assumed to point to a buffer of at least
  3926.     bufLen characters.
  3927.     Ten characters should be enough for register names
  3928.  
  3929.     reg:   name index of register
  3930.     buf:    points to array of char's
  3931.     bufLen: size of buf array
  3932.  
  3933. */
  3934.  
  3935. void    BorDebugRegIndexToName(BorDebugCookie registerCookie,
  3936.                                unsigned int   reg,
  3937.                                char         * buf,
  3938.                                unsigned int   bufLen);
  3939.  
  3940.  
  3941. /*
  3942.  
  3943.     BorDebugTypeIndexToString
  3944.  
  3945.  
  3946.     This API is usefull in two cases:
  3947.     - If the type index is less than 0x1000, the type is a basic
  3948.       (built-in) type, and you can get the string representation
  3949.       of this type.
  3950.     - If the high bit of type index is turned on, meaning type
  3951.       index is negative if cast to an integer, this means that
  3952.       the type is an external type.  The index number of this
  3953.       external type is simply the type index multiplied by -1.
  3954.       This function will return a string representation in the
  3955.       form : EI[XXX], where XXX is the external type index.
  3956.  
  3957.     For user defined types, where the type index is in the range
  3958.     of 0x1000 - 0x7FFFFFFF, this function will simply return
  3959.     the type as a string.
  3960.  
  3961.  
  3962.     Go from a type index to a string representation
  3963.     Buf is assumed to point to a buffer of at least
  3964.     bufLen characters.
  3965.     A buffer of 260 char's is enough for all type names
  3966.  
  3967.     typeIndex: type index
  3968.     buf:       points to array of char's
  3969.     bufLen:    size of buf array
  3970.  
  3971. */
  3972.  
  3973. void    BorDebugTypeIndexToString(BorDebugCookie registerCookie,
  3974.                                   unsigned int   typeIndex,
  3975.                                   char         * buf,
  3976.                                   unsigned int   bufLen);
  3977.  
  3978.  
  3979.  
  3980. //---------------------------------------------------------------------
  3981.  
  3982. /*
  3983.  
  3984.     Unmangling entry point
  3985.  
  3986.     BorDebugUmKind  BorDebugUnmangle(char         * src,
  3987.                                      char         * dest,
  3988.                                      unsigned int   maxlen,
  3989.                                      char         * qualP,
  3990.                                      char         * baseP,
  3991.                                      int            doArgs)
  3992.  
  3993.  
  3994.     This is the main entry-point for the unmangler code.  To use it, pass
  3995.     the following arguments:
  3996.  
  3997.        src      the source buffer, NULL terminated, which contains
  3998.                 the mangled name.  If this pointer is NULL, unmangle()
  3999.                 will return UM_NOT_MANGLED.
  4000.  
  4001.        dest     the destination buffer.  If this pointer is NULL,
  4002.                 unmangle() will return UM_ERROR.
  4003.  
  4004.        maxlen   the maximum number of bytes which should be output
  4005.                 to the destination buffer.  Remember to account for
  4006.                 the NULL that will be output at the end of the mangled
  4007.                 name.
  4008.  
  4009.                 It is impossible to know beforehand exactly how long a
  4010.                 mangled name should be, but due to restrictions in the
  4011.                 length of linker names, imposed by the OMF format, a
  4012.                 buffer of at least 2K bytes or longer should always be
  4013.                 sufficient.
  4014.  
  4015.                 If the size of the buffer is insufficient, unmangle()
  4016.                 will return with the flag UM_BUFOVRFLW set in the return
  4017.                 code.  Any other flags set in the return code will
  4018.                 reflect whatever information unmangle() was able to
  4019.                 determine before the overflow occurred.
  4020.  
  4021.        qualP    if non-NULL, this argument should point to the address
  4022.                 of a buffer large enough to contain the qualifier part
  4023.                 of the unmangled name.  For example, if the unmangled
  4024.                 name is "foo::bar::baz", then the qualifier would be
  4025.                 "foo::bar".
  4026.  
  4027.                 Thus, this buffer should always be at least as large as
  4028.                 the destination buffer, in order to ensure that memory
  4029.                 overwrites never occur.
  4030.  
  4031.        baseP    if non-NULL, this argument should point to the address
  4032.                 of a buffer large enough to contain the basename part
  4033.                 of the unmangled name.  For example, if the unmangled
  4034.                 name is "foo::bar::baz", then the basename would be
  4035.                 "baz".  See the documentation of "qualP" for further
  4036.                 notes on the required length of this buffer.
  4037.  
  4038.        doArgs   if this argument is non-0 (aka TRUE), it means that
  4039.                 when unmangling a function name, its arguments should
  4040.                 also be unmangled as part of the output name.
  4041.                 Otherwise, only the name will be unmangled, and not
  4042.                 the arguments.
  4043.  
  4044.     The return code of this function contains a series of flags, some of
  4045.     which are mutually exclusive, and some of which represent the status
  4046.     of the unmangled name.  These flags are:
  4047.  
  4048.         General:
  4049.         --------
  4050.  
  4051.         0x80000000  BORDEBUG_UM_NOT_MANGLED
  4052.  
  4053.             If the return value equals this flag, then
  4054.             it is the only flag which will be set, all
  4055.             other values being irrelevant.
  4056.  
  4057.  
  4058.  
  4059.         The kind of symbol (mutually exclusive):
  4060.         ----------------------------------------
  4061.  
  4062.         0x00000000  BORDEBUG_UM_UNKNOWN
  4063.  
  4064.             Symbol of unknown type
  4065.  
  4066.         0x00000001  BORDEBUG_UM_FUNCTION
  4067.  
  4068.             Global function, or member function
  4069.  
  4070.         0x00000002  BORDEBUG_UM_CONSTRUCTOR
  4071.  
  4072.             Class constructor function
  4073.  
  4074.         0x00000003  BORDEBUG_UM_DESTRUCTOR
  4075.  
  4076.             Class destructor function
  4077.  
  4078.         0x00000004  BORDEBUG_UM_OPERATOR
  4079.  
  4080.             Global operator, or member operator
  4081.  
  4082.         0x00000005  BORDEBUG_UM_CONVERSION
  4083.  
  4084.             Member conversion operator
  4085.  
  4086.         0x00000006  BORDEBUG_UM_DATA
  4087.  
  4088.             Class static data member
  4089.  
  4090.         0x00000007  BORDEBUG_UM_THUNK
  4091.  
  4092.             (16-bit only, no longer used)
  4093.  
  4094.         0x00000008  BORDEBUG_UM_TPDSC
  4095.  
  4096.             Type descriptor object (RTTI)
  4097.  
  4098.         0x00000009  BORDEBUG_UM_VTABLE
  4099.  
  4100.             Class virtual table
  4101.  
  4102.         0x0000000a  BORDEBUG_UM_VRDF_THUNK
  4103.  
  4104.             Virtual table thunk (special)
  4105.  
  4106.         0x000000ff  BORDEBUG_UM_KINDMASK
  4107.  
  4108.             This mask can be used to exclude all other
  4109.             flags from the return type, except the
  4110.             symbol kind.
  4111.  
  4112.  
  4113.         Modifiers (not mutually exclusive):
  4114.         -----------------------------------
  4115.  
  4116.         0x00000100  BORDEBUG_UM_QUALIFIED
  4117.  
  4118.             A member symbol, either of a class or of a namespace
  4119.  
  4120.         0x00000200  BORDEBUG_UM_TEMPLATE
  4121.  
  4122.             A template specialization symbol
  4123.  
  4124.  
  4125.         Modifiers (mutually exclusive):
  4126.         -------------------------------
  4127.  
  4128.         0x00000400  BORDEBUG_UM_VIRDEF_FLAG
  4129.  
  4130.             Virdef flag (special)
  4131.  
  4132.         0x00000800  BORDEBUG_UM_FRIEND_LIST
  4133.  
  4134.             Friend list (special)
  4135.  
  4136.         0x00001000  BORDEBUG_UM_CTCH_HNDL_TBL
  4137.  
  4138.             Catch handler table (exception handling)
  4139.  
  4140.         0x00002000  BORDEBUG_UM_OBJ_DEST_TBL
  4141.  
  4142.             Object destructor table (exception handling)
  4143.  
  4144.         0x00004000  BORDEBUG_UM_THROW_LIST
  4145.  
  4146.             Throw list (exception handling)
  4147.  
  4148.         0x00008000  BORDEBUG_UM_EXC_CTXT_TBL
  4149.  
  4150.             Exception context table (exception handling)
  4151.  
  4152.         0x00010000  BORDEBUG_UM_LINKER_PROC
  4153.  
  4154.             Special linker procedure (#pragma package)
  4155.  
  4156.         0x0001fc00  BORDEBUG_UM_SPECMASK
  4157.  
  4158.             Special flags mask.  Use this to extract only
  4159.             these special, mutually exclusive, flags.
  4160.  
  4161.         0x00ffff00  BORDEBUG_UM_MODMASK
  4162.  
  4163.             This mask can be used to access any of the
  4164.             symbol modifiers, whether mutually exclusive
  4165.             or not.
  4166.  
  4167.  
  4168.         Error flags (not mutually exclusive):
  4169.         -------------------------------------
  4170.  
  4171.         0x01000000  BORDEBUG_UM_BUFOVRFLW
  4172.  
  4173.             The output buffer has been overflowed
  4174.  
  4175.         0x02000000  BORDEBUG_UM_HASHTRUNC
  4176.  
  4177.             The input name was truncated by a hash code
  4178.  
  4179.         0x04000000  BORDEBUG_UM_ERROR
  4180.  
  4181.             Some other error has occurred
  4182.  
  4183.         0x7f000000  BORDEBUG_UM_ERRMASK
  4184.  
  4185.             Use this mask to examine only the error flags
  4186.  
  4187.  
  4188.  
  4189.     It is recommended to use the main output buffer.  The "qualP" and
  4190.     "baseP" arguments are there mostly for backwards compatibility.
  4191.  
  4192.     Note on exceptional conditions: Sometimes a mangled name does not
  4193.     have the correct format.  This can happen if garbage code is passed
  4194.     in, or a mangled name from a different, or older product, is used.
  4195.     In this case, you will notice a number enclosed in curly-braces at
  4196.     the point in the name where the fault was detected.
  4197.  
  4198.     For example, a false name like "@foo@$z" will generate an error like
  4199.     "foo::{853}...", because "$z" does not represent a valid special
  4200.     function name.  In this case, the number 853 represents the line in
  4201.     UM.C where the error was found.
  4202.  
  4203.     If you are debugging a problem with unmangling in a case where
  4204.     examining the mangled name under the debugger is not convenient, you
  4205.     can tell the unmangler to output the mangled form of the name in the
  4206.     output buffer by setting the environment variable SHOW_TROUBLED_NAME
  4207.     to any textual value.  In that case, the output buffer for the
  4208.     example above would contain the string "foo::{853: @foo@$z}".
  4209.  
  4210.  
  4211. */
  4212.  
  4213.  
  4214. typedef enum
  4215. {
  4216.         /* The kind of symbol. */
  4217.  
  4218.         BORDEBUG_UM_UNKNOWN       = 0x00000000,
  4219.  
  4220.         BORDEBUG_UM_FUNCTION      = 0x00000001,
  4221.         BORDEBUG_UM_CONSTRUCTOR   = 0x00000002,
  4222.         BORDEBUG_UM_DESTRUCTOR    = 0x00000003,
  4223.         BORDEBUG_UM_OPERATOR      = 0x00000004,
  4224.         BORDEBUG_UM_CONVERSION    = 0x00000005,
  4225.  
  4226.         BORDEBUG_UM_DATA          = 0x00000006,
  4227.         BORDEBUG_UM_THUNK         = 0x00000007,
  4228.         BORDEBUG_UM_TPDSC         = 0x00000008,
  4229.         BORDEBUG_UM_VTABLE        = 0x00000009,
  4230.         BORDEBUG_UM_VRDF_THUNK    = 0x0000000a,
  4231.  
  4232.         BORDEBUG_UM_KINDMASK      = 0x000000ff,
  4233.  
  4234.         /* Modifier (is it a member, template?). */
  4235.  
  4236.         BORDEBUG_UM_QUALIFIED     = 0x00000100,
  4237.         BORDEBUG_UM_TEMPLATE      = 0x00000200,
  4238.  
  4239.         BORDEBUG_UM_VIRDEF_FLAG   = 0x00000400,
  4240.         BORDEBUG_UM_FRIEND_LIST   = 0x00000800,
  4241.         BORDEBUG_UM_CTCH_HNDL_TBL = 0x00001000,
  4242.         BORDEBUG_UM_OBJ_DEST_TBL  = 0x00002000,
  4243.         BORDEBUG_UM_THROW_LIST    = 0x00004000,
  4244.         BORDEBUG_UM_EXC_CTXT_TBL  = 0x00008000,
  4245.         BORDEBUG_UM_LINKER_PROC   = 0x00010000,
  4246.         BORDEBUG_UM_SPECMASK      = 0x0001fc00,
  4247.  
  4248.         BORDEBUG_UM_MODMASK       = 0x00ffff00,
  4249.  
  4250.         /* Some kind of error occurred. */
  4251.  
  4252.         BORDEBUG_UM_BUFOVRFLW     = 0x01000000,
  4253.         BORDEBUG_UM_HASHTRUNC     = 0x02000000,
  4254.         BORDEBUG_UM_ERROR         = 0x04000000,
  4255.  
  4256.         BORDEBUG_UM_ERRMASK       = 0x7f000000,
  4257.  
  4258.         /* This symbol is not a mangled name. */
  4259.  
  4260.         BORDEBUG_UM_NOT_MANGLED   = 0x80000000,
  4261. }
  4262.         BorDebugUmKind;
  4263.  
  4264.  
  4265. BorDebugUmKind  BorDebugUnmangle(char   *       src,
  4266.                                  char   *       dest,
  4267.                                  unsigned       maxlen,
  4268.                                  char   *       qualP,
  4269.                                  char   *       baseP,
  4270.                                  int            doArgs);
  4271.  
  4272.  
  4273. //---------------------------------------------------------------------
  4274.  
  4275.  
  4276. #ifdef  __cplusplus
  4277. }   // extern "C"
  4278. #endif
  4279.  
  4280. #endif  // BORDEBUG_H
  4281.  
  4282. //---------------------------------------------------------------------
  4283.